<?xml version="1.0" encoding="windows-1252"?>
<node id="376104" title="Re: brian's Guide to Solving Any Perl Problem" created="2004-07-20 18:05:55" updated="2005-08-10 14:51:02">
<type id="11">
note</type>
<author id="299049">
ysth</author>
<data>
<field name="doctext">
Don't forget to look at the code &lt;em&gt;after&lt;/em&gt; the line number in the message, too.  Compare:
&lt;code&gt;
$ 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";
 }
&lt;/code&gt;</field>
<field name="root_node">
376075</field>
<field name="parent_node">
376075</field>
</data>
</node>
