use strict; use warnings; my @list = split /\n/, < 1){ $buf .= " end"; }elsif ($occurrances ==1){ $buf .= " one"; } $occurrances = 1; } (! defined $max) || ($num1 && $num1 > $max ) and $max = $num1; (! defined $min) || ($num1 && $num1 < $min) and $min=$num1 ; print "$buf\n" if $buf; $buf = $_; $oldname1=$name1; } print "Min=$min; Max=$max\n";