in reply to Re^2: Batch processing of files
in thread Batch processing of files

If you wanted to append to an exiting file, I'd still move the open outside of the loop. Why would you want to open the file repeatedly here?

Anyway, both of our solution are wrong. It shouldn't be moved outside of the loop. I missed the rename originally.

Replies are listed 'Best First'.
Re^4: Batch processing of files
by kennethk (Abbot) on Feb 11, 2010 at 18:46 UTC
    For the given code, I would not. I also would not open the same file twice in a loop instead of seek, fail to test my opens, or use external input in the statement open(FH,"$file");. But given the combination of "Here's part of the script" with the tendency for some posted scripts to not correspond to actual code, it seems that piece of information is potentially pertinent as is the tutorial.