use Scalar::Util qw( looks_like_number ); while( <> ) { next unless looks_like_number($_); chomp; $min = ! defined( $min ) || $min > $_ ? $_ : $min; $max = ! defined( $max ) || $max < $_ ? $_ : $max; } print "\nminimum number: $min\n"; print "maximum number: $max\n";
Dave
In reply to Re: storage of numbers
by davido
in thread storage of numbers
by ostra
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |