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
In Section
Seekers of Perl Wisdom