<?xml version="1.0"?>
<?xml-stylesheet type="text/css" href="https://script.spoken-tutorial.org/skins/common/feed.css?303"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
		<id>https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=PERL%2FC3%2FSample-PERL-program%2FEnglish</id>
		<title>PERL/C3/Sample-PERL-program/English - Revision history</title>
		<link rel="self" type="application/atom+xml" href="https://script.spoken-tutorial.org/index.php?action=history&amp;feed=atom&amp;title=PERL%2FC3%2FSample-PERL-program%2FEnglish"/>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=PERL/C3/Sample-PERL-program/English&amp;action=history"/>
		<updated>2026-05-06T05:24:20Z</updated>
		<subtitle>Revision history for this page on the wiki</subtitle>
		<generator>MediaWiki 1.23.17</generator>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=PERL/C3/Sample-PERL-program/English&amp;diff=24370&amp;oldid=prev</id>
		<title>Nancyvarkey at 11:35, 9 November 2015</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=PERL/C3/Sample-PERL-program/English&amp;diff=24370&amp;oldid=prev"/>
				<updated>2015-11-09T11:35:04Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;a href=&quot;https://script.spoken-tutorial.org/index.php?title=PERL/C3/Sample-PERL-program/English&amp;amp;diff=24370&amp;amp;oldid=24337&quot;&gt;Show changes&lt;/a&gt;</summary>
		<author><name>Nancyvarkey</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=PERL/C3/Sample-PERL-program/English&amp;diff=24337&amp;oldid=prev</id>
		<title>Nirmala Venkat at 12:02, 5 November 2015</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=PERL/C3/Sample-PERL-program/English&amp;diff=24337&amp;oldid=prev"/>
				<updated>2015-11-05T12:02:40Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Revision as of 12:02, 5 November 2015&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 87:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 87:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Here I have used''' references''' to create complex data structures to hold the data required for a weather report.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Here I have used''' references''' to create complex data structures to hold the data required for a weather report.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;−&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''$weather_report''' is a''' hash reference''' &lt;del class=&quot;diffchange diffchange-inline&quot;&gt;with 5 keys&lt;/del&gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;'''$weather_report''' is a''' hash reference'''.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;“'''place'''” and “'''nstate'''” has the scalar values.&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;“'''place'''” and “'''nstate'''” has the scalar values.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Nirmala Venkat</name></author>	</entry>

	<entry>
		<id>https://script.spoken-tutorial.org/index.php?title=PERL/C3/Sample-PERL-program/English&amp;diff=24333&amp;oldid=prev</id>
		<title>Nirmala Venkat: Created page with &quot;'''Title of script''':''' Sample PERL Program'''  '''Author: Nirmala Venkat'''  '''Keywords: module, package, array, hash, functions, reference, dereference, PERL, PERL progra...&quot;</title>
		<link rel="alternate" type="text/html" href="https://script.spoken-tutorial.org/index.php?title=PERL/C3/Sample-PERL-program/English&amp;diff=24333&amp;oldid=prev"/>
				<updated>2015-11-05T09:36:36Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;&amp;#039;&amp;#039;&amp;#039;Title of script&amp;#039;&amp;#039;&amp;#039;:&amp;#039;&amp;#039;&amp;#039; Sample PERL Program&amp;#039;&amp;#039;&amp;#039;  &amp;#039;&amp;#039;&amp;#039;Author: Nirmala Venkat&amp;#039;&amp;#039;&amp;#039;  &amp;#039;&amp;#039;&amp;#039;Keywords: module, package, array, hash, functions, reference, dereference, PERL, PERL progra...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;'''Title of script''':''' Sample PERL Program'''&lt;br /&gt;
&lt;br /&gt;
'''Author: Nirmala Venkat'''&lt;br /&gt;
&lt;br /&gt;
'''Keywords: module, package, array, hash, functions, reference, dereference, PERL, PERL programming, video tutorial'''&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
{| style=&amp;quot;border-spacing:0;&amp;quot;&lt;br /&gt;
| style=&amp;quot;background-color:#c0c0c0;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &amp;lt;center&amp;gt;'''Visual Cue'''&amp;lt;/center&amp;gt;&lt;br /&gt;
| style=&amp;quot;background-color:#c0c0c0;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &amp;lt;center&amp;gt;'''Narration'''&amp;lt;/center&amp;gt;&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Slide 1:&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Welcome to the''' Spoken Tutorial''' on''' Sample PERL program.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Slide 2:&lt;br /&gt;
&lt;br /&gt;
Learning objectives&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| In this tutorial we will learn to &lt;br /&gt;
&lt;br /&gt;
* include all the major topics we covered so far&lt;br /&gt;
* in a sample Perl program&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Slide 3:&lt;br /&gt;
&lt;br /&gt;
System Requirements&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| To record this tutorial, I am using&lt;br /&gt;
&lt;br /&gt;
* '''Ubuntu Linux 12.04''' operating system&lt;br /&gt;
* '''Perl 5.14.2'''&lt;br /&gt;
* and the''' gedit''' Text Editor&lt;br /&gt;
&lt;br /&gt;
You can use any text editor of your choice.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Slide 4:&lt;br /&gt;
&lt;br /&gt;
Pre-requisites&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| As a prerequisite, you should have working knowledge of '''Perl''' Programming.&lt;br /&gt;
&lt;br /&gt;
If not, then go through the relevant''' Perl''' spoken tutorials on this website.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Slide 5:&lt;br /&gt;
&lt;br /&gt;
Program outline:&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| The sample Perl program will give the output of various weather forecast reports of a region.&lt;br /&gt;
&lt;br /&gt;
'''Weather.pm''' is a''' module''' file that has a complex data structure to hold the data required for this program.&lt;br /&gt;
&lt;br /&gt;
It also contains various '''functions '''to generate the report.&lt;br /&gt;
&lt;br /&gt;
'''Weather''' '''underscore report.pl''' is the''' perl''' program which makes use of this '''module '''file to give the required output.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border-top:none;border-bottom:1pt solid #000000;border-left:1pt solid #000000;border-right:1pt solid #000000;padding:0.097cm;&amp;quot;| The same code files are available under this video of our website. Download and unzip the files provided in the code file link.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Switch to the''' Weather.pm '''in''' gedit'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Now let us see our sample '''Perl '''program '''Weather dot pm.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| '''Highlight the code line by line.'''&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| The block of code in this program is under the '''namespace Weather'''.&lt;br /&gt;
'''Perl '''implements '''namespace '''using the''' package keyword.'''&lt;br /&gt;
&lt;br /&gt;
'''BEGIN''' block is compiled and executed before the main program.&lt;br /&gt;
&lt;br /&gt;
'''Export''' allows to export the '''functions''' and variables of '''modules''' to user's '''namespace'''.&lt;br /&gt;
&lt;br /&gt;
'''At the rate EXPORT''' and''' at the rate EXPORT underscore OK''' are the two main variables used during export operation.&lt;br /&gt;
&lt;br /&gt;
'''At the rate EXPORT''' contains list of '''subroutines''' and variables of the '''module.'''&lt;br /&gt;
&lt;br /&gt;
These will be exported into the caller '''namespace.'''&lt;br /&gt;
&lt;br /&gt;
'''At the rate EXPORT underscore OK''' does export of symbols on demand basis.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Here I have used''' references''' to create complex data structures to hold the data required for a weather report.&lt;br /&gt;
&lt;br /&gt;
'''$weather_report''' is a''' hash reference''' with 5 keys.&lt;br /&gt;
&lt;br /&gt;
“'''place'''” and “'''nstate'''” has the scalar values.&lt;br /&gt;
&lt;br /&gt;
“'''weekly'''” is '''hash''' of''' hash references'''.&lt;br /&gt;
&lt;br /&gt;
Each week day has four '''keys''' - &lt;br /&gt;
&lt;br /&gt;
'''max underscore temp, min underscore temp, sunrise, sunset.'''&lt;br /&gt;
&lt;br /&gt;
“'''record underscore time'''” is an''' array reference''' with two index values.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| I have a few '''subroutines''' to display the weather report of various options. &lt;br /&gt;
&lt;br /&gt;
Let us see one by one.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Highlight''' display_header()'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| This function prints the header information such as header of the report, place, state and current date.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Now let us see the next function''' display underscore daily underscore report.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Highlight''' display_daily_report()'''&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| This '''function '''prints the daily report on the screen depending upon the weekday input.&lt;br /&gt;
&lt;br /&gt;
We retrieve the parameter passed into a '''subroutine''' using the''' shift function.'''&lt;br /&gt;
&lt;br /&gt;
I have used the''' trim function''' to remove the leading and trailing spaces of the parameter value.&lt;br /&gt;
&lt;br /&gt;
Here is the code for the '''trim''' '''function'''.&lt;br /&gt;
&lt;br /&gt;
'''Lc function''' returns a lowercase version of the given input.&lt;br /&gt;
&lt;br /&gt;
This is used to avoid case-sensitivity.&lt;br /&gt;
&lt;br /&gt;
The week day passed as parameter from the main program, is assigned to a''' local variable''' '''dollar week underscore day'''.&lt;br /&gt;
&lt;br /&gt;
The following '''print statements''' will print the data corresponding to a specified week day.&lt;br /&gt;
&lt;br /&gt;
We are using the '''arrow operator''' to''' dereference''' a value in '''$weather underscore report'''.&lt;br /&gt;
&lt;br /&gt;
When working with '''references''', we have to understand the '''data type '''we are '''dereferencing'''.&lt;br /&gt;
&lt;br /&gt;
If it is a '''hash''', we need to pass the '''key '''in curly braces.&lt;br /&gt;
&lt;br /&gt;
If it is an '''array,''' we need to use the square brackets with the index values.&lt;br /&gt;
&lt;br /&gt;
'''return function''' of '''Perl''' returns a value.&lt;br /&gt;
&lt;br /&gt;
This can be used to check the status of the '''function''' in the main program.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| The next '''function''' is''' write underscore daily underscore report.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Highlight''' write_daily_report()'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| This '''function''' will print the report output to a file.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| The''' open function''' with the greater than (&amp;gt;) symbol defines the''' WRITE''' mode.&lt;br /&gt;
&lt;br /&gt;
Filename is created with the weekday name and '''dot txt '''extension.&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| '''Highlight the print statements'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| The '''print statements''' will print the corresponding data of a specified week day to a file.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Highlight''' display_weekly_report()'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| This prints the weekly report.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| I have declared a '''foreach loop''' to loop through each weekday of the''' hash reference'''.&lt;br /&gt;
&lt;br /&gt;
I have used curly brackets to represent the''' hash reference''' and the '''arrow '''operator to''' dereference'''.&lt;br /&gt;
&lt;br /&gt;
I am using the''' “keys” built-in function '''to loop through the '''keys '''of the '''hash'''.&lt;br /&gt;
&lt;br /&gt;
'''Display underscore daily underscore report function '''will print each element of the '''hash'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Now let us see a '''Perl '''program '''weather underscore report dot pl '''where we will make use of this '''module '''file '''Weather dot pm'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Highlight the code according to the narration.&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Here, '''use strict''' and''' use warnings''' are compiler flags that helps to avoid common programming mistakes.&lt;br /&gt;
&lt;br /&gt;
'''use Weather semicolon.'''&lt;br /&gt;
&lt;br /&gt;
Here '''Weather '''is a''' module''' name which I have used in this program.&lt;br /&gt;
&lt;br /&gt;
We have already seen that the '''functions''' required for this program have been stored in this''' module'''.&lt;br /&gt;
&lt;br /&gt;
It is not required to give the''' .pm''' file extension here.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| In this program, I'll print different reports depending upon the given options.&lt;br /&gt;
&lt;br /&gt;
The user has to enter an option to print the&lt;br /&gt;
&lt;br /&gt;
# daily weather report of a particular week day&lt;br /&gt;
# daily weather report of a particular week day to an output file&lt;br /&gt;
# weekly weather report&lt;br /&gt;
&lt;br /&gt;
If option 1 is typed, it will ask the user to enter the day of a week.&lt;br /&gt;
&lt;br /&gt;
The '''diamond '''operator will read from''' STDIN''', that is from the keyboard.&lt;br /&gt;
&lt;br /&gt;
For example, if the user enters ''''monday'''', then it is assigned to a variable '''dollar dayoption, '''which is a''' local variable'''.&lt;br /&gt;
&lt;br /&gt;
Next, we can see that we are calling two functions''' display_header()''' and''' display_daily_report().'''&lt;br /&gt;
&lt;br /&gt;
We have exported all '''functions''' in '''Weather.pm''' with “'''use Weather'''” statement in this file.&lt;br /&gt;
&lt;br /&gt;
So, no need to refer the '''functions''' within a package using the '''colon colon (::)package qualifier'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Now let's see the next option.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| If option 2 is typed, it will prompt the user to enter the day of a week.&lt;br /&gt;
&lt;br /&gt;
'''$dayoption''' is passed as the input parameter to the '''function write underscore daily underscore report.'''&lt;br /&gt;
&lt;br /&gt;
'''return '''value from the '''function''' is stored in the variable '''dollar result'''.&lt;br /&gt;
&lt;br /&gt;
'''Print statement''' asks the user to check the text file for the output.&lt;br /&gt;
&lt;br /&gt;
The filename is created with the day of the week dot txt as output file.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| If option 3 is typed, it prints the weather report for the whole week.&lt;br /&gt;
&lt;br /&gt;
'''Display underscore weekly underscore report''' is the '''function''' name of the weekly report.&lt;br /&gt;
&lt;br /&gt;
This print statement draws a horizontal line for the specified number of times.&lt;br /&gt;
&lt;br /&gt;
This is just to give a good look to the report.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Lastly, if the option is 4, it will quit the program.&lt;br /&gt;
&lt;br /&gt;
If any option, other than the ones specified is given, the''' print statement''' says “'''Incorrect option'''”.&lt;br /&gt;
&lt;br /&gt;
Here the exit value of 0 indicates the program ran successfully.&lt;br /&gt;
&lt;br /&gt;
The exit value other than 0 means an error of some kind has occurred. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Now let us execute the program.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| On the terminal type&lt;br /&gt;
&lt;br /&gt;
'''perl weather_report. Pl'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;'''press''' Enter.'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Switch to the '''terminal '''and type&lt;br /&gt;
&lt;br /&gt;
'''perl weather underscore report dot pl'''&lt;br /&gt;
and press''' Enter'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| 1.Daily Weather Report&lt;br /&gt;
&lt;br /&gt;
2.Daily Weather Report to File&lt;br /&gt;
&lt;br /&gt;
3.Weekly Weather Report&lt;br /&gt;
&lt;br /&gt;
4.Exit&lt;br /&gt;
&lt;br /&gt;
Enter the Option: 1&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;'''press''' Enter.'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| We can see four options on the screen.&lt;br /&gt;
&lt;br /&gt;
Type '''1 '''and press '''Enter.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Enter a day: monday&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;'''press''' Enter.'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| We are prompted to enter a day of the week.&lt;br /&gt;
&lt;br /&gt;
I'll type ''''monday'''' and press '''Enter'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Highlight the header of the report&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| This is the header output generated from the '''function display underscore header().'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Highlight the monday report&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Now, we can see the weather report of Monday.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Now I'll again execute the program once again to demonstrate the other options.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| On the terminal type&lt;br /&gt;
&lt;br /&gt;
'''perl weather_report. Pl'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;'''press''' Enter.'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| 1.Daily Weather Report&lt;br /&gt;
&lt;br /&gt;
2.Daily Weather Report to File&lt;br /&gt;
&lt;br /&gt;
3.Weekly Weather Report&lt;br /&gt;
&lt;br /&gt;
4.Exit&lt;br /&gt;
&lt;br /&gt;
Enter the Option: 2&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;'''press''' Enter.'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Type '''2 '''and press '''Enter.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Enter a day: wednesday&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;'''press''' Enter.'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| At the prompt, we have to type any week day.&lt;br /&gt;
&lt;br /&gt;
I will type ‘'''wednesday’''' and press '''Enter'''.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| We can see a message “Please check the file wednesday dot txt for report output ”.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| The output has been written to this text file. &lt;br /&gt;
&lt;br /&gt;
Let us open the file and check the content.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| On the terminal type&lt;br /&gt;
&lt;br /&gt;
'''gedit wednesday.txt'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;'''press''' Enter.'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Type '''gedit wednesday dot txt''' and press''' Enter.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Highlight the output&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| The output file has been created with the entered week day name with '''txt''' extension.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Now let us check the next option.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| On the terminal type&lt;br /&gt;
&lt;br /&gt;
'''perl weather_report. Pl'''&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;'''press''' Enter.'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Switch to the terminal and type''' perl weather underscore report dot pl '''and press''' Enter'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| 1.Daily Weather Report&lt;br /&gt;
&lt;br /&gt;
2.Daily Weather Report to File&lt;br /&gt;
&lt;br /&gt;
3.Weekly Weather Report&lt;br /&gt;
&lt;br /&gt;
4.Exit&lt;br /&gt;
&lt;br /&gt;
Enter the Option: 3&lt;br /&gt;
&lt;br /&gt;
'''&amp;gt;&amp;gt;'''press''' Enter.'''&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Type '''3 '''and press '''Enter.'''&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Highlight the output&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| This time, we can see the weekly weather report.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| The''' hash keys''' and''' hash values''' are stored in a random order.&lt;br /&gt;
&lt;br /&gt;
So the displayed output is not related to the order in which they were added.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.106cm;&amp;quot;| With this, we come to the end of this tutorial.&lt;br /&gt;
&lt;br /&gt;
Let us summarize.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Slide 6:&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.106cm;&amp;quot;| In this tutorial we have seen a sample '''Perl''' program by covering main topics of our previous tutorials. &lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Slide 7:&lt;br /&gt;
&lt;br /&gt;
Assignment&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.106cm;&amp;quot;| As an assignment,&lt;br /&gt;
&lt;br /&gt;
# Write a similar '''Perl''' program '''employee underscore report.pl''' for displaying employee salary, designation, department, leave_balance details.&lt;br /&gt;
# Pass Employee ID or Employee name as input.&lt;br /&gt;
# Write the required functions in the module '''Employee.pm '''file.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Slide 8:&lt;br /&gt;
&lt;br /&gt;
About Spoken Tutorial project&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| The video at the following link summarises the Spoken Tutorial project.&lt;br /&gt;
&lt;br /&gt;
Please download and watch it&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Slide 9:&lt;br /&gt;
&lt;br /&gt;
Spoken Tutorial workshops&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.106cm;&amp;quot;| We conduct workshops and give certificates for those who pass our online tests.&lt;br /&gt;
&lt;br /&gt;
For more details, please write to us.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Slide 10:&lt;br /&gt;
&lt;br /&gt;
Acknowledgement&lt;br /&gt;
&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| Spoken Tutorial project is funded by NMEICT, MHRD, Government of India.&lt;br /&gt;
&lt;br /&gt;
More information on this mission is available at&lt;br /&gt;
this link.&lt;br /&gt;
&lt;br /&gt;
|-&lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| &lt;br /&gt;
| style=&amp;quot;border:1pt solid #000000;padding:0.097cm;&amp;quot;| This is Nirmala Venkat from IIT Bombay, signing off. Thanks for watching.&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>Nirmala Venkat</name></author>	</entry>

	</feed>