use File::DosGlob 'glob'; @files_to_pull = glob("???4000?.*"); foreach $file(@files_to_pull){ print "\n$file"; }