in reply to Re^2: Use of uninitialized value
in thread Use of uninitialized value
You only ever initialise $numerator or $denominatormy $numerator; my $denominator; if ($indicator eq "SH"){ $numerator = $last_element; } elsif ($indicator eq "SL"){ $denominator = $last_element; } else { print "\nError: There has been an unexpected string within + the second to last element of the array\n"; }
might work, if 0 is a suitable default value for you.my $numerator = 0; my $denominator = 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Use of uninitialized value
by Anonymous Monk on Nov 23, 2010 at 11:59 UTC | |
by cjb (Friar) on Nov 23, 2010 at 12:20 UTC |