in reply to Get number ranges from files internally?
Don't read the entire file into an array -- that's slow, and it isn't necessary. Do something like
instead. Much simpler.while (<>) { next if ( $_ !~ /\d/ ); # Skip records w/o numeric fields # Match, print if within range here.. }
Also, don't try to do everything in one line -- even :) if Perl will let you do that. If I were doing this project, I would probably split the incoming data line into an array (splitting on spaces) and then deal with the individual elements. If the date matches a particular value, then I would look at the time, splitting it on the ':', comparing to the time range that you want.
--t. alex
"Excellent. Release the hounds." -- Monty Burns.
|
|---|