in reply to How would I print the last element of a loop?
If this is homework and "spaceship operator" is allowed...to get the larger number:
@nums = (57, 113, 25, 76, 712, 13, 3); foreach (sort {$a <=> $b} @nums) { $larger = $_ } print "The numbers: @nums\n\nlarger=$larger\n";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: How would I print the last element of a loop?
by Fletch (Bishop) on Apr 02, 2004 at 19:00 UTC |