Jun 21, 2001, 10:48 PM
Post #2 of 5
Hello again xMattHawkx. I don't know the answer for sure, but remember that your original file is renamed to it's original name, along with whatever you've assigned to $^I tacked on to the end. The file that is written to is dealt with through the ARGV file handle. You can explicitly create the new file with ARGV, and you don't have to give it the file name...
...so, although I don't know for sure, I assume you could...
my $filename = "/path/to/data.txt";
@ARGV = ($filename);
$^I = ".bak";
open( ARGV );
s/(.*)/$1\n26\|Testing 123/ if eof;
...just like a normal file open. If you test it, please let me know because I havn't tested this on my unix yet. And by the way, there's no need to scope $^I or @ARGV as they're special.