Commits

Anonymous committed cdafe78

Updated the Perl-for-Newbies presentations up to 2009-07-31-rev1.

Comments (0)

Files changed (31)

lib/tutorials/perl-for-newbies/lect2-all-in-one/files/print2.pl

+use strict;
+use warnings;
+
 open SEQ1, ">", "seq1.txt";
 open SEQ2, ">", "seq2.txt";
 

lib/tutorials/perl-for-newbies/lect2-all-in-one/functions/pythagoras.pl

+use strict;
+use warnings;
+
 sub pythagoras
 {
     my ($x, $y);

lib/tutorials/perl-for-newbies/lect2-all-in-one/functions/splitting.pl

+use strict;
+use warnings;
 
 sub mysplit
 {

lib/tutorials/perl-for-newbies/lect2-all-in-one/functions/splitting_shift.pl

+use strict;
+use warnings;
 
 sub mysplit
 {

lib/tutorials/perl-for-newbies/lect2-all-in-one/hashes/bank.old.pl

+use strict;
+use warnings;
+
 while (1)
 {
     print "Please enter what you want to do:\n";

lib/tutorials/perl-for-newbies/lect2-all-in-one/index.html

 </p>
 <div class="code_block"><pre>
 <span class="Statement">use strict</span>;
+<span class="Statement">use warnings</span>;
 
 <span class="Statement">my</span> (<span class="Identifier">@primes</span>, <span class="Identifier">$i</span>);
 
-MAIN_LOOP: <span class="Statement">for</span>(
+<span class="Statement">MAIN_LOOP:</span> <span class="Statement">for</span>(
     <span class="Identifier">@primes</span>=(<span class="Constant">2</span>), <span class="Identifier">$i</span>=<span class="Constant">3</span> ;
     <span class="Statement">scalar</span>(<span class="Identifier">@primes</span>) &lt; <span class="Constant">200</span> ;
     <span class="Identifier">$i</span>++
 right triangle according to its other sides:
 </p>
 <div class="code_block"><pre>
-<span class="Statement">sub</span><span class="Identifier"> </span><span class="Identifier">pythagoras</span>
+<span class="Statement">use strict</span>;
+<span class="Statement">use warnings</span>;
+
+<span class="Statement">sub </span><span class="Identifier">pythagoras</span>
 {
     <span class="Statement">my</span> (<span class="Identifier">$x</span>, <span class="Identifier">$y</span>);
 
 splitting 10 among three numbers:
 </p>
 <div class="code_block"><pre>
-<span class="Statement">sub</span><span class="Identifier"> </span><span class="Identifier">mysplit</span>
+<span class="Statement">use strict</span>;
+<span class="Statement">use warnings</span>;
+
+<span class="Statement">sub </span><span class="Identifier">mysplit</span>
 {
     <span class="Statement">my</span> (<span class="Identifier">$total</span>, <span class="Identifier">$num_elems</span>, <span class="Identifier">@accum</span>) = <span class="Identifier">@_</span>;
     <span class="Statement">my</span> (<span class="Identifier">@ret</span>, <span class="Identifier">@new_accum</span>);
     <span class="Statement">for</span>(<span class="Statement">my</span> <span class="Identifier">$a</span>=<span class="Constant">0</span>;<span class="Identifier">$a</span>&lt;=<span class="Identifier">$total</span>;<span class="Identifier">$a</span>++)
     {
         <span class="Identifier">@new_accum</span> = (<span class="Identifier">@accum</span>, <span class="Identifier">$a</span>);
-        mysplit(<span class="Identifier">$total</span>-<span class="Identifier">$a</span>, <span class="Identifier">$num_elems</span><span class="Constant">-1</span>, <span class="Identifier">@new_accum</span>);
+        mysplit(<span class="Identifier">$total</span>-<span class="Identifier">$a</span>, <span class="Identifier">$num_elems</span>-<span class="Constant">1</span>, <span class="Identifier">@new_accum</span>);
     }
 }
 
 re-written using <tt>shift</tt>:
 </p>
 <div class="code_block"><pre>
-<span class="Statement">sub</span><span class="Identifier"> </span><span class="Identifier">mysplit</span>
+<span class="Statement">use strict</span>;
+<span class="Statement">use warnings</span>;
+
+<span class="Statement">sub </span><span class="Identifier">mysplit</span>
 {
     <span class="Statement">my</span> <span class="Identifier">$total</span> = <span class="Statement">shift</span>;
     <span class="Statement">my</span> <span class="Identifier">$num_elems</span> = <span class="Statement">shift</span>;
     <span class="Statement">for</span>(<span class="Statement">my</span> <span class="Identifier">$a</span>=<span class="Constant">0</span>;<span class="Identifier">$a</span>&lt;=<span class="Identifier">$total</span>;<span class="Identifier">$a</span>++)
     {
         <span class="Identifier">@new_accum</span> = (<span class="Identifier">@accum</span>, <span class="Identifier">$a</span>);
-        mysplit(<span class="Identifier">$total</span>-<span class="Identifier">$a</span>, <span class="Identifier">$num_elems</span><span class="Constant">-1</span>, <span class="Identifier">@new_accum</span>);
+        mysplit(<span class="Identifier">$total</span>-<span class="Identifier">$a</span>, <span class="Identifier">$num_elems</span>-<span class="Constant">1</span>, <span class="Identifier">@new_accum</span>);
     }
 }
 
 , 3, 3.5...
 </p>
 <div class="code_block"><pre>
+<span class="Statement">use strict</span>;
+<span class="Statement">use warnings</span>;
+
 <span class="Statement">open</span> <span class="Identifier">SEQ1</span>, <span class="Constant">&quot;</span><span class="Constant">&gt;</span><span class="Constant">&quot;</span>, <span class="Constant">&quot;</span><span class="Constant">seq1.txt</span><span class="Constant">&quot;</span>;
 <span class="Statement">open</span> <span class="Identifier">SEQ2</span>, <span class="Constant">&quot;</span><span class="Constant">&gt;</span><span class="Constant">&quot;</span>, <span class="Constant">&quot;</span><span class="Constant">seq2.txt</span><span class="Constant">&quot;</span>;
 
 {
     <span class="Statement">print</span> <span class="Identifier">SEQ1</span> <span class="Identifier">$a</span>, <span class="Constant">&quot;</span><span class="Special">\n</span><span class="Constant">&quot;</span>;
     <span class="Statement">print</span> <span class="Identifier">SEQ2</span> <span class="Identifier">$a</span>, <span class="Constant">&quot;</span><span class="Special">\n</span><span class="Constant">&quot;</span>;
-    <span class="Statement">print</span> <span class="Identifier">SEQ1</span> (<span class="Identifier">$a</span><span class="Constant">+0.1</span>);
-    <span class="Statement">print</span> <span class="Identifier">SEQ2</span> (<span class="Identifier">$a</span><span class="Constant">+0.5</span>);
+    <span class="Statement">print</span> <span class="Identifier">SEQ1</span> (<span class="Identifier">$a</span>+<span class="Constant">0.1</span>);
+    <span class="Statement">print</span> <span class="Identifier">SEQ2</span> (<span class="Identifier">$a</span>+<span class="Constant">0.5</span>);
     <span class="Statement">print</span> <span class="Identifier">SEQ1</span> <span class="Constant">&quot;</span><span class="Special">\n</span><span class="Constant">&quot;</span>;
     <span class="Statement">print</span> <span class="Identifier">SEQ2</span> <span class="Constant">&quot;</span><span class="Special">\n</span><span class="Constant">&quot;</span>;
 }
 </p>
 <div class="code_block"><pre>
 <span class="Statement">use strict</span>;
+<span class="Statement">use warnings</span>;
 
 <span class="Statement">my</span> <span class="Identifier">$string</span> = <span class="Statement">lc</span>(<span class="Statement">shift</span>(<span class="Identifier">@ARGV</span>));
 
-<span class="Statement">if</span> (<span class="Identifier">$string</span> =~<span class="Statement"> /</span><span class="Special">\$</span><span class="Special">[A-Za-z_]</span><span class="Statement">/</span>)
+<span class="Statement">if</span> (<span class="Identifier">$string</span> =~ <span class="Statement">/</span><span class="Special">\$</span><span class="Special">[A-Za-z_]</span><span class="Statement">/</span>)
 {
     <span class="Statement">print</span> <span class="Constant">&quot;</span><span class="Constant">True</span><span class="Special">\n</span><span class="Constant">&quot;</span>;
 }
 (<tt>?</tt>) after them. Here's an example:
 </p>
 <div class="code_block"><pre>
+<span class="Statement">use strict</span>;
+<span class="Statement">use warnings</span>;
+
 <span class="Statement">my</span> <span class="Identifier">$string</span> = <span class="Constant">&quot;</span><span class="Constant">&lt;html&gt;Hello&lt;/html&gt;You&lt;/html&gt;</span><span class="Constant">&quot;</span>;
 
 <span class="Statement">my</span> <span class="Identifier">$greedy</span> = <span class="Identifier">$string</span>;
 The following example sorts an array of integers numerically:
 </p>
 <div class="code_block"><pre>
+<span class="Statement">use strict</span>;
+<span class="Statement">use warnings</span>;
+
 <span class="Statement">my</span> <span class="Identifier">@array</span> = (<span class="Constant">100</span>,<span class="Constant">5</span>,<span class="Constant">8</span>,<span class="Constant">92</span>,-<span class="Constant">7</span>,<span class="Constant">34</span>,<span class="Constant">29</span>,<span class="Constant">58</span>,<span class="Constant">8</span>,<span class="Constant">10</span>,<span class="Constant">24</span>);
 
 <span class="Statement">my</span> <span class="Identifier">@sorted_array</span> =
 example could be re-written as:
 </p>
 <div class="code_block"><pre>
+<span class="Statement">use strict</span>;
+<span class="Statement">use warnings</span>;
+
 <span class="Statement">my</span> <span class="Identifier">@array</span> = (<span class="Constant">100</span>,<span class="Constant">5</span>,<span class="Constant">8</span>,<span class="Constant">92</span>,-<span class="Constant">7</span>,<span class="Constant">34</span>,<span class="Constant">29</span>,<span class="Constant">58</span>,<span class="Constant">8</span>,<span class="Constant">10</span>,<span class="Constant">24</span>);
 
 <span class="Statement">my</span> <span class="Identifier">@sorted_array</span> = (<span class="Statement">sort {</span> <span class="Identifier">$a</span> &lt;=&gt; <span class="Identifier">$b</span> <span class="Statement">}</span> <span class="Identifier">@array</span>);
 </p>
 <div class="code_block"><pre>
 <span class="Statement">use strict</span>;
+<span class="Statement">use warnings</span>;
 
 <span class="Statement">my</span> <span class="Identifier">@input</span> = (
     <span class="Constant">&quot;</span><span class="Constant">Hello World!</span><span class="Constant">&quot;</span>,

lib/tutorials/perl-for-newbies/lect2-all-in-one/my/primes_us.pl

 use strict;
+use warnings;
 
 my (@primes, $i);
 

lib/tutorials/perl-for-newbies/lect2-all-in-one/regexps/perl_var.pl

 use strict;
+use warnings;
 
 my $string = lc(shift(@ARGV));
 

lib/tutorials/perl-for-newbies/lect2-all-in-one/regexps/sentence_with_numbers.pl

 use strict;
+use warnings;
 
 my $string = lc(shift(@ARGV));
 

lib/tutorials/perl-for-newbies/lect2-all-in-one/regexps/substitute/ungreedy.pl

+use strict;
+use warnings;
+
 my $string = "<html>Hello</html>You</html>";
 
 my $greedy = $string;

lib/tutorials/perl-for-newbies/lect2-all-in-one/useful_funcs/sort/integer_sort.pl

+use strict;
+use warnings;
+
 my @array = (100,5,8,92,-7,34,29,58,8,10,24);
 
 my @sorted_array = 

lib/tutorials/perl-for-newbies/lect2-all-in-one/useful_funcs/sort/integer_sort_cmp.pl

+use strict;
+use warnings;
+
 my @array = (100,5,8,92,-7,34,29,58,8,10,24);
 
 my @sorted_array = (sort { $a <=> $b } @array);

lib/tutorials/perl-for-newbies/lect2-all-in-one/useful_funcs/sort/reverse_string_sort.pl

 use strict;
+use warnings;
 
 my @input = (
     "Hello World!",

lib/tutorials/perl-for-newbies/lect3-all-in-one/index.html

 its name:
 </p>
 <div class="code_block"><pre>
-<span class="Statement">sub</span><span class="Identifier"> </span><span class="Identifier">get_name</span>
+<span class="Statement">sub </span><span class="Identifier">get_name</span>
 {
     <span class="Comment"># This step is necessary so it will be treated as a method</span>
     <span class="Statement">my</span> <span class="Identifier">$self</span> = <span class="Statement">shift</span>;
     <span class="Statement">return</span> <span class="Identifier">$self</span>-&gt;{<span class="Constant">'</span><span class="Constant">name</span><span class="Constant">'</span>};
 }
 
-<span class="Statement">sub</span><span class="Identifier"> </span><span class="Identifier">assign_name</span>
+<span class="Statement">sub </span><span class="Identifier">assign_name</span>
 {
     <span class="Statement">my</span> <span class="Identifier">$self</span> = <span class="Statement">shift</span>;
 

lib/tutorials/perl-for-newbies/lect3-all-in-one/objects/making/Bar2.pm

 package Bar2;
 
 use strict;
+use warnings;
 
 use vars qw(@ISA);
 

lib/tutorials/perl-for-newbies/lect3-all-in-one/objects/making/Foo2/Foo.pm

 #
 package Foo;
 
+use strict;
+use warnings;
+
 sub new
 {
     # Retrieve the package's string.

lib/tutorials/perl-for-newbies/lect3-all-in-one/objects/making/Foo2/test.pl

 #!/usr/bin/perl
 
 use strict;
+use warnings;
 
 use Foo;
 

lib/tutorials/perl-for-newbies/lect3-all-in-one/objects/making/inheritance/Foo.pm

 #
 package Foo;
 
+use strict;
+use warnings;
+
 sub new
 {
     # Retrieve the package's string.

lib/tutorials/perl-for-newbies/lect3-all-in-one/objects/making/inheritance/test_bar.pl

 #!/usr/bin/perl
 
 use strict;
+use warnings;
 
 use Bar;
 

lib/tutorials/perl-for-newbies/lect3-all-in-one/objects/making/inheritance/test_bar2.pl

 #!/usr/bin/perl
 
 use strict;
+use warnings;
+
 
 use Bar2;
 

lib/tutorials/perl-for-newbies/lect3-all-in-one/objects/making/test_count.pl

 #!/usr/bin/perl
 
 use strict;
+use warnings;
 
 use Count;
 

lib/tutorials/perl-for-newbies/lect4-all-in-one/and_or/shift-or.pl

-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
+
 
 # shift by default shifts from @ARGV in the main program
 my $start = shift || 1;

lib/tutorials/perl-for-newbies/lect4-all-in-one/and_or/sort-or.pl

-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
+
 
 my @array = 
 (

lib/tutorials/perl-for-newbies/lect4-all-in-one/exceptions/die-eval.pl

-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
+
 
 sub read_text
 {

lib/tutorials/perl-for-newbies/lect4-all-in-one/index.html

 <span class="PreProc">#!/usr/bin/perl -w</span>
 
 <span class="Statement">use strict</span>;
+<span class="Statement">use warnings</span>;
+
 
 <span class="Statement">my</span> <span class="Identifier">$h</span> = <span class="Constant">q{</span><span class="Constant">Hello There</span><span class="Constant">}</span>;
 <span class="Statement">print</span> <span class="Constant">qq|</span><span class="Identifier">$h</span><span class="Constant">, world!</span><span class="Special">\n</span><span class="Constant">|</span>;
 <span class="Statement">my</span> <span class="Identifier">@a</span> = <span class="Constant">qw{</span><span class="Constant">one two three</span><span class="Constant">}</span>;
 <span class="Statement">for</span> <span class="Statement">my</span> <span class="Identifier">$i</span> (<span class="Constant">0</span> .. <span class="Identifier">$#a</span>)
 {
-    <span class="Statement">print</span> <span class="Constant">&quot;</span><span class="Constant">$i: </span><span class="Identifier">$a</span><span class="Constant">[</span><span class="Identifier">$i</span><span class="Constant">]</span><span class="Special">\n</span><span class="Constant">&quot;</span>;
+    <span class="Statement">print</span> <span class="Constant">&quot;</span><span class="Identifier">$i</span><span class="Constant">: </span><span class="Identifier">$a</span><span class="Constant">[</span><span class="Identifier">$i</span><span class="Constant">]</span><span class="Special">\n</span><span class="Constant">&quot;</span>;
 }
 </pre></div>
 <p>
 <span class="PreProc">#!/usr/bin/perl -w</span>
 
 <span class="Statement">use strict</span>;
+<span class="Statement">use warnings</span>;
+
 
 <span class="Statement">my</span> <span class="Identifier">$a</span> = <span class="Constant">&quot;</span><span class="Constant">Hello</span><span class="Constant">&quot;</span>;
 <span class="Statement">my</span> <span class="Identifier">$str</span> = <span class="Constant">&quot;</span><span class="Constant">There you go.</span><span class="Constant">&quot;</span>;
 Here are some examples, that will only work on UNIX systems.
 </p>
 <div class="code_block"><pre>
-<span class="PreProc">#!/usr/bin/perl -w</span>
+<span class="PreProc">#!/usr/bin/perl</span>
 
 <span class="Statement">use strict</span>;
+<span class="Statement">use warnings</span>;
 
 <span class="Statement">system</span>(<span class="Constant">&quot;</span><span class="Constant">ls -l /</span><span class="Constant">&quot;</span>);
 
 like this:
 </p>
 <div class="code_block"><pre>
-<span class="PreProc">#!/usr/bin/perl -w</span>
+<span class="PreProc">#!/usr/bin/perl</span>
 
 <span class="Statement">use strict</span>;
+<span class="Statement">use warnings</span>;
+
 
 <span class="Comment"># shift by default shifts from @ARGV in the main program</span>
 <span class="Statement">my</span> <span class="Identifier">$start</span> = <span class="Statement">shift</span> || <span class="Constant">1</span>;
-<span class="Statement">my</span> <span class="Identifier">$end</span> = <span class="Statement">shift</span> || (<span class="Identifier">$start</span><span class="Constant">+9</span>);
+<span class="Statement">my</span> <span class="Identifier">$end</span> = <span class="Statement">shift</span> || (<span class="Identifier">$start</span>+<span class="Constant">9</span>);
 
 <span class="Statement">for</span> <span class="Statement">my</span> <span class="Identifier">$i</span> (<span class="Identifier">$start</span> .. <span class="Identifier">$end</span>)
 {
 name as well, you can write the following:
 </p>
 <div class="code_block"><pre>
-<span class="PreProc">#!/usr/bin/perl -w</span>
+<span class="PreProc">#!/usr/bin/perl</span>
 
 <span class="Statement">use strict</span>;
+<span class="Statement">use warnings</span>;
+
 
 <span class="Statement">my</span> <span class="Identifier">@array</span> =
 (
 Here's an example:
 </p>
 <div class="code_block"><pre>
-<span class="PreProc">#!/usr/bin/perl -w</span>
+<span class="PreProc">#!/usr/bin/perl</span>
 
 <span class="Statement">use strict</span>;
+<span class="Statement">use warnings</span>;
 
-<span class="Statement">sub</span><span class="Identifier"> </span><span class="Identifier">read_text</span>
+
+<span class="Statement">sub </span><span class="Identifier">read_text</span>
 {
     <span class="Statement">my</span> <span class="Identifier">$filename</span> = <span class="Constant">&quot;</span><span class="Constant">../hello/there.txt</span><span class="Constant">&quot;</span> ;
     <span class="Statement">open</span> <span class="Identifier">I</span>, <span class="Constant">&quot;</span><span class="Constant">&lt;</span><span class="Identifier">$filename</span><span class="Constant">&quot;</span>
         <span class="Statement">or</span> <span class="Statement">die</span> <span class="Constant">&quot;</span><span class="Constant">Could not open </span><span class="Identifier">$filename</span><span class="Constant">&quot;</span>;
-    <span class="Statement">my</span> <span class="Identifier">$text</span> = <span class="Statement">join</span>(<span class="Constant">&quot;&quot;</span>,&lt;I&gt;);
+    <span class="Statement">my</span> <span class="Identifier">$text</span> = <span class="Statement">join</span>(<span class="Constant">&quot;&quot;</span>,<span class="Identifier">&lt;I&gt;</span>);
     <span class="Statement">close</span>(<span class="Identifier">I</span>);
 
     <span class="Statement">return</span> <span class="Identifier">$text</span>;
 }
 
-<span class="Statement">sub</span><span class="Identifier"> </span><span class="Identifier">write_text</span>
+<span class="Statement">sub </span><span class="Identifier">write_text</span>
 {
     <span class="Statement">my</span> <span class="Identifier">$text</span> = <span class="Statement">shift</span>;
     <span class="Statement">my</span> <span class="Identifier">$filename</span> = <span class="Constant">&quot;</span><span class="Constant">../there/hello.txt</span><span class="Constant">&quot;</span>;
     <span class="Statement">close</span>(<span class="Identifier">O</span>);
 }
 
-<span class="Statement">sub</span><span class="Identifier"> </span><span class="Identifier">read_and_write</span>
+<span class="Statement">sub </span><span class="Identifier">read_and_write</span>
 {
     <span class="Statement">my</span> <span class="Identifier">$text</span> = read_text();
 
     write_text(<span class="Identifier">$text</span>);
 }
 
-<span class="Statement">sub</span><span class="Identifier"> </span><span class="Identifier">perform_transaction</span>
+<span class="Statement">sub </span><span class="Identifier">perform_transaction</span>
 {
     <span class="Statement">eval</span> {
     read_and_write();
 Here's an example that counts the number of mp3s in a directory:
 </p>
 <div class="code_block"><pre>
-<span class="PreProc">#!/usr/bin/perl -w</span>
+<span class="PreProc">#!/usr/bin/perl</span>
 
 <span class="Statement">use strict</span>;
+<span class="Statement">use warnings</span>;
 
-<span class="Statement">sub</span><span class="Identifier"> </span><span class="Identifier">get_dir_files</span>
+
+<span class="Statement">sub </span><span class="Identifier">get_dir_files</span>
 {
     <span class="Statement">my</span> <span class="Identifier">$dir_path</span> = <span class="Statement">shift</span>;
 
     <span class="Identifier">@entries</span> = <span class="Statement">readdir</span>(<span class="Identifier">D</span>);
     <span class="Statement">closedir</span>(<span class="Identifier">D</span>);
 
-    <span class="Statement">return</span> <span class="Identifier">\@entries</span>;
+    <span class="Statement">return</span> \<span class="Identifier">@entries</span>;
 }
 
 <span class="Statement">my</span> <span class="Identifier">$dir_path</span> = <span class="Statement">shift</span> || <span class="Constant">&quot;</span><span class="Constant">.</span><span class="Constant">&quot;</span>;
 
 <span class="Statement">my</span> <span class="Identifier">$entries</span> = get_dir_files(<span class="Identifier">$dir_path</span>);
-<span class="Statement">my</span> <span class="Identifier">@mp3s</span> = (<span class="Statement">grep</span> { <span class="Statement">/</span><span class="Special">\.</span><span class="Constant">mp3$</span><span class="Statement">/</span> } <span class="Identifier">@$entries</span>);
+<span class="Statement">my</span> <span class="Identifier">@mp3s</span> = (<span class="Statement">grep {</span> <span class="Statement">/</span><span class="Special">\.</span><span class="Constant">mp3$</span><span class="Statement">/</span> <span class="Statement">}</span> <span class="Identifier">@$entries</span>);
 
 <span class="Statement">print</span> <span class="Constant">&quot;</span><span class="Constant">You have </span><span class="Constant">&quot;</span> . <span class="Statement">scalar</span>(<span class="Identifier">@mp3s</span>) . <span class="Constant">&quot;</span><span class="Constant"> mp3s in </span><span class="Identifier">$dir_path</span><span class="Constant">.</span><span class="Special">\n</span><span class="Constant">&quot;</span>;
 </pre></div>
 equivalent:
 </p>
 <div class="code_block"><pre>
-<span class="PreProc">#!/usr/bin/perl -w</span>
+<span class="PreProc">#!/usr/bin/perl</span>
 
 <span class="Statement">use strict</span>;
+<span class="Statement">use warnings</span>;
 
 <span class="Statement">use </span>Fcntl;
 

lib/tutorials/perl-for-newbies/lect4-all-in-one/processes/system.pl

-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
 
 system("ls -l /");
 

lib/tutorials/perl-for-newbies/lect4-all-in-one/string-forms/here-doc.pl

 #!/usr/bin/perl -w
 
 use strict;
+use warnings;
+
 
 my $a = "Hello";
 my $str = "There you go.";

lib/tutorials/perl-for-newbies/lect4-all-in-one/string-forms/q_qq-examples.pl

 #!/usr/bin/perl -w
 
 use strict;
+use warnings;
+
 
 my $h = q{Hello There};
 print qq|$h, world!\n|;

lib/tutorials/perl-for-newbies/lect4-all-in-one/system-funcs/r.pl

-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
 
 use Fcntl;
 

lib/tutorials/perl-for-newbies/lect4-all-in-one/system-funcs/rot13.pl

 #!/usr/bin/perl -w
 
 use strict;
+use warnings;
+
 
 use Fcntl qw(:seek);
 

lib/tutorials/perl-for-newbies/lect4-all-in-one/system-funcs/search-mp3s.pl

-#!/usr/bin/perl -w
+#!/usr/bin/perl
 
 use strict;
+use warnings;
+
 
 sub get_dir_files
 {
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.