jesuashok has asked for the wisdom of the Perl Monks concerning the following question:
Hi all great people,
Today I read about using $^I from the following node in perlmonks,
Use $^I (was Re: updating a file)
After that I have written a samle code and checked for the same.
I got the following error.#!/bin/perl local $^I = "sub/.bak"; local @ARGV = ('/home/antony/perl/l.pl'); while ( <> ) { s/instance/NEW_PATTERN/; print; }
1) what's wrong with the above code? Is the backup should reside in the same directory?Error: Can't rename /home/antony/perl/l.pl to /home/antony/perl/l.plsub/.bak: + No such file or directory, skipping file at l line 6.
"Keep pouring your ideas"
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Not able Create Backup file when using INPLACE_EDIT ( $^I )
by davido (Cardinal) on May 02, 2006 at 04:25 UTC | |
by merlyn (Sage) on May 02, 2006 at 05:07 UTC | |
Re: Not able Create Backup file when using INPLACE_EDIT ( $^I )
by Hue-Bond (Priest) on May 02, 2006 at 04:24 UTC |
Back to
Seekers of Perl Wisdom