in reply to Re: storage of numbers
in thread storage of numbers
Laurent, use strict; would have caught your typo.
I prefer to get the special cases out of the way early.
use strict; use warnings; my ($min, $max) = (0, 0); while(<DATA>){ chomp( my $input = $_ ); last if $input eq ''; $min = $input if $input < $min; $max = $input if $input > $max; } print "Min and Max are : $min $max \n"; __DATA__ 11 13 56 75 53 68 89 22
Bill
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: storage of numbers
by Laurent_R (Canon) on Oct 17, 2013 at 17:12 UTC |
In Section
Seekers of Perl Wisdom