in reply to Get number ranges from files internally?
Note that you should prompt the user for the time range (begin and end times). Either that or specify that they type in the begin time for a given interval (seconds, minutes, hours). The first method would be simpler to implement. I've simplified your problem but you should get the gist of it:
Results:use strict; my ($beg, $end) = qw(00:01:20 00:02:20); print "beg: $beg end: $end\n"; print "Matches\n--------\n"; while (<DATA>) { 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
HTH,beg: 00:01:20 end: 00:02:20 Matches -------- 00:01:20 00:01:21 00:02:00 00:02:20
--Jim
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Get number ranges from files internally?
by brassmon_k (Sexton) on Dec 31, 2001 at 23:21 UTC |