in reply to foreach nightmare!
that should be okay. Why do you think there is a problem? Your problems are here:my @well = split ('', $well); $highest = $well[0]; # definately problems here, cant pick out $ +well[0]
You could also write your loop with:for ($i = 0; $i < @well; $i++) { # scalar(@well) here if ($well[$i] > $highest) { $highest = $numbers[$i]; # $well[$i] here } }
foreach $number (@well) { $highest=$number if $highest<$number; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: foreach nightmare!
by chip (Curate) on May 08, 2003 at 16:14 UTC |