in reply to Extract the middle part of a list

I don't think the default sort is numeric, I think it's ascii... I seem to have to sort { $a<=>$b } @ar to get numeric things to happen.

If your subset is much smaller than the 10k in the dir, it might not be efficient to push them all into a giant array and push them through grep, map, map, sort. It might be better to do something more like:

while( my $ent = readdir $dirhandle ) { next if $stuff or $ent =~ m/\./; push @wanted, $ent if $various and $things; }

-Paul