[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Omaha.pm] silly warnings





On Sat, Jan 17, 2009 at 10:50 AM, Jay Hannah <jay@jays.net> wrote:
On Jan 15, 2009, at 1:18 PM, Dan Linder wrote:
>From this site URL: http://www.xav.com/perl/lib/Pod/perllexwarn.html
Looks like I need to wrapper line 55 like this:

55            } else {
56                ($value, $parm)=split(/\s+/,$line,2);
                 no warnings qw(uninitialized);
57                $myhash1{$section_name}{$parm} = $value;
                 use warnings qw(uninitialized);
58            }

Line 57 has 4 moving parts, any of which will throw a warning if things aren't kosher.

- Is %myhash1 guaranteed to be defined?
- Is $section_name guaranteed to be defined?
- Is $parm guaranteed to be defined?
- Is $value guaranteed to be defined?

The lines of code that I didn't include are a definition of the %myhash1, $section_name, and $line. 

True $value and $param could possibly be incorrect, but that'll be blamed on the input file that fills in the $line variable.

And thanks for the un-needed "use warnings" post line 57.  (I was thinking I'd have to save $^W somehow and re-apply it...)

I'll hopefully get this played with later today and report back my findings.

Dan

--
"Quis custodiet ipsos custodes?" (Who can watch the watchmen?) -- from the Satires of Juvenal
"I do not fear computers, I fear the lack of them." -- Isaac Asimov (Author)
** *** ***** ******* *********** *************