in reply to Optimizing I/O intensive subroutine

I'm clutching at straws here, but if a lot of the filenames contain multiple whitespace characters, then you might get a very slight improvement doing this:

my @f = split / /, $_, 11; # skip files that have a space or other whitespace # characters in their name next if @f > 10;

The third parameter to split tells it not to keep looking for split points once it's found 10.

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'