in reply to A question of efficiency

Does your script take more time and memory? Remember that you have to count the time and memory used by external processes, as well.

Also, you should probably use glob() to get the same results, rather than reading all the filenames and filtering them:

foreach my $entry (glob('10.*')) { }