in reply to storage of numbers

Simplified array insert, in case you do need the list for later processing. Also corrected typo in last statement (and updated to fix my own to end on null input).
#!/perl/ -w use strict; my (@nums,$input); #array of numbers while(<>){ chomp($input=$_); last if ($input eq ''); push @nums, $input; } @nums= sort {$a<=>$b} @nums; print "\nminimum number: $nums[0]"; print "\nmaximum number: $nums[$#nums]";