in reply to Get number ranges from files internally?

First a few comments. You really should  use strict; and make an attempt to indent your code so that it is marginally readable to those willing to help you. You'll get quicker responses and more of them.

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:

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
Results:
beg: 00:01:20 end: 00:02:20 Matches -------- 00:01:20 00:01:21 00:02:00 00:02:20
HTH,

--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
    I'll get back to you guys. I integrated what you 2 said and I got it working but I want to dress it up a bit. I'll show ya it when I'm done...It's pretty cool.