in reply to Loop Break
You could use glob to get the file names. Something like
for my $file (glob('*')) { #....do stuff } [download]
But do check the help first, glob takes a file match pattern NOT a regex :)