in reply to Is this code logical?

Where does the function "remove" come from? It isn't a built-in function. Do you mean "unlink"?
The parameters for "rename" should be the other way around and do not need quotes around them.
Why declare "our @data" and not "my @data"?
If the file is huge, the process will be slow since you're slurping the whole file in. It would be better to read and process line by line.

-imran

Replies are listed 'Best First'.
Re^2: Is this code logical?
by Win (Novice) on Feb 24, 2006 at 14:24 UTC
    The file names are the correct way round. I want the content of the old file name to be the same as the content of the new file name.