in reply to Opening files from a directory and batch processing into new files

If you are running this on a shell (bash or ksh), you could simply do:

for f in *RAN*.log; do ./script.pl < $f > $f.pd; done

where script.pl might look like:

#!/usr/bin/perl while (<STDIN>) { # do something print "output\n"; }

Replies are listed 'Best First'.
Re^2: Opening files from a directory and batch processing into new files
by savem (Initiate) on Aug 04, 2011 at 20:55 UTC

    That would be so much more simple! Alas, my supervisor has requested I do it in perl.:/ Thanks for the advice though!