for my $row (@{$dates}) { $seasons{'low'} = $row->[0] if ($row->[0] < $seasons{'low'}); $seasons{'high'} = $row->[1] if ($row->[1] > $seasons{'high'}); } #### for my $row (@{$dates}) { $seasons{'low'} = $row->[0] if ($row->[0] < $seasons{'low'}); print "$row->[2]\n" if $!; $seasons{'high'} = $row->[1] if ($row->[1] > $seasons{'high'}); }