in reply to finding specific files

Do not fear the glob operator, which should work just fine here:
for my $file (glob "[0-9][0-9][0-9][0-9]*") { ... }

-- Randal L. Schwartz, Perl hacker