use strict; my ($beg, $end) = qw(00:01:20 00:02:20); print "beg: $beg end: $end\n"; print "Matches\n--------\n"; while () { chomp; if (($_ ge $beg) && ($_ le $end)) { print "$_\n"; } } __DATA__ 00:01:01 01:01:01 00:01:20 00:01:21 00:02:00 00:02:21 00:02:20 00:01:19 #### beg: 00:01:20 end: 00:02:20 Matches -------- 00:01:20 00:01:21 00:02:00 00:02:20