Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^3: Use of uninitialized value

by chromatic (Archbishop)
on Nov 23, 2010 at 19:19 UTC ( [id://873275]=note: print w/replies, xml ) Need Help??


in reply to Re^2: Use of uninitialized value
in thread Use of uninitialized value

my $numerator; my $denominator;

Here both $numerator and $denominator contain undef.

if ($indicator eq "SH"){ $numerator = $last_element; }

If that branch is true, $numerator will contain the value of $last_element, which may be undef. $denominator will still contain undef.

elsif ($indicator eq "SL"){ $denominator = $last_element; }

If that branch is true (and it will only be true if the first branch is false, in which case $numerator will still contain undef), $denominator will contain the value of $last_element, which may be undef.

else { print "\nError: There has been an unexpected string within the sec +ond to last element of the array\n"; }

If this branch is true, both $numerator and $denominator contain undef.

At this point, at least one of those two variables does contain undef. Both may.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (2)
As of 2026-04-18 17:34 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    hippoepoptai's answer Re: how do I set a cookie and redirect was blessed by hippo!
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.