Beefy Boxes and Bandwidth Generously Provided by pair Networks
more useful options
 
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 having a coffee break in the Monastery: (3)
As of 2024-04-26 00:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found