Sharan wrote:
> 
> Hello,

Hello,

> I lost my files, while using perl -pi -e.
> I wanted to replace a world in a set of files, "perl -pi -e
> 's/somestring/somethingelse/g' *.pl"
> but, it gave error saying permission denied and all the files got deleted.
> 
> If it cant rewrite the files, at least it should not delete.

Supply a string to the -i switch and perl will save the original file
with that string appended to the file name.  For example:

perl -pi.bak -s's/somestring/somethingelse/g' textfile.txt

Will save the original file as "textfile.txt.bak" and the modified file
as "textfile.txt"


John
-- 
use Perl;
program
fulfillment

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to