in reply to How can I run an folder full of text files through a perl script?
Using glob can be done, for example, like this:
and now you can just use while(<>){...}. On each line, $ARGV contains the current file name, and eof can be used to detect when the current file is finished, and the next file will start to be used.chdir $dir; @ARGV = glob "*.txt";
Or you can just loop through the file list yourself and open each file in turn.
|
|---|