in reply to Time Intervals

Construct a hash of arrays keyed by value in the file, containing arrays of lines for each value in case there is more than one time period with the same value. Use List::Util->max to find the largest key in the hash and print the line(s) associated with it.

knoppix@Microknoppix:~$ perl -Mstrict -Mwarnings -MList::Util=max -E ' > open my $fh, q{<}, \ <<EOD or die $!; > 10:38:34 759 > 10:43:34 735 > 10:48:34 817 > 10:53:34 648 > 10:58:34 817 > 11:03.34 774 > EOD > > my %byValue; > while ( <$fh> ) > { > my $value = ( split )[ 1 ]; > push @{ $byValue{ $value } }, $_; > } > > print for @{ $byValue{ max keys %byValue } };' 10:48:34 817 10:58:34 817 knoppix@Microknoppix:~$

I hope this is helpful.

Cheers,

JohnGG