If you are simply passing through the file editing it then a common Perl idiom is to use inplace edit thus:
local @ARGV = ('nameOfFileToEdit'); local $^I = '.bak'; # extension for backup version of file while (<>) { #line read is in $_ print "new state of line\n"; # write updated line }
In reply to Re: open file for read/write
by GrandFather
in thread open file for read/write
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |