in reply to read a file twice...

In the spirit of TMTOWTDI, why not just keep track of the text along the way? If the number and the text are on the same line, easy money. Here's what I've got (I'm going to assume the format <text>:<number>)
while(<FILE>) { @array = split ':'; if (@array[1] > $max) #number we read in is greater than current max { $max = $array[1]; $max_text = $array[0]; } #similarly for min }
Of course, your file layout may be more complex.