in reply to Re^2: processing a lot of files
in thread processing a lot of files

try the following on the command line
perl -e 'opendir DIR, "./";@directory =readdir(DIR);for $entry (@direc +tory){print "$entry\n";}'
in your while loop in the failing example $f is a string with the name of a file in it, you have to open, process and close the file inside the loop