Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: brian's Guide to Solving Any Perl Problem

by ysth (Canon)
on Jul 20, 2004 at 22:05 UTC ( [id://376104]=note: print w/replies, xml ) Need Help??


in reply to brian's Guide to Solving Any Perl Problem

Don't forget to look at the code after the line number in the message, too. Compare:
$ cat -n elsif.pl 1 use strict; 2 use warnings; 3 4 our $foo; 5 6 if ($^O eq "23niWSM") { 7 print "bugaboo\n"; 8 } 9 elsif ($foo eq "bar") { 10 print "foobar\n"; 11 } $ perl elsif.pl Use of uninitialized value in string eq at elsif.pl line 6. $ cat -n if.pl 1 use strict; 2 use warnings; 3 4 our $foo; 5 6 if ($^O eq "23niWSM") { 7 print "bugaboo\n"; 8 } 9 if ($foo eq "bar") { 10 print "foobar\n"; 11 } $ perl if.pl Use of uninitialized value in string eq at if.pl line 9. $ diff -u if.pl elsif.pl --- if.pl 2004-07-20 15:00:49.412472000 -0700 +++ elsif.pl 2004-07-20 15:02:28.875492800 -0700 @@ -6,6 +6,6 @@ if ($^O eq "23niWSM") { print "bugaboo\n"; } -if ($foo eq "bar") { +elsif ($foo eq "bar") { print "foobar\n"; }

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://376104]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2025-06-15 12:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.