in reply to Extract the middle part of a list
You want grep, with some data extraction in the choice routine.
Not having to sort helps, since we don't need to keep values for comparison. If there are files there which don't follow the naming scheme, you may need to filter them out with another grep or with map, or a refinement of the glob in angles.our ($starttime, $endtime) = init(); # . . . my @selected = grep { my $time = (split /[_.]/)[2]; $time > $starttime and $time <= $endtime;; } </path/to/*>;
After Compline,
Zaxo
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^2: Extract the middle part of a list
by chrism01 (Friar) on Jun 29, 2007 at 04:51 UTC | |
by Zaxo (Archbishop) on Jun 29, 2007 at 05:04 UTC | |
by chrism01 (Friar) on Jun 29, 2007 at 05:38 UTC | |
by doom (Deacon) on Jun 29, 2007 at 10:00 UTC |
In Section
Seekers of Perl Wisdom