On Mon, Jun 09, 2003 at 03:22:52PM +0100 Rob Dixon wrote: > Tassilo Von Parseval wrote:
> > You can use the same underlying technique from within a Perl script. You > > have to set two special variables accordingly and Perl can even do an > > inplace-edit: > > > > local $^I = 1; # enable inplace editing > > local @ARGV = "blah.txt"; # make it accessible with <> > > while (<>) { > > s/blabla/BLABLA/; > > print; > > } > > The value of $^I is the string to be appended to the backup copy of > the original file. The above will edit 'blah.txt' and rename the original > file to 'blah.txt1'. Indeed, yes. I wonder how people can memorize that because I've been getting it wrong for three years. The letter 'i' never fails to trick me into believing that it's a boolean switch turning on or off inplace-editing altogether. Tassilo -- $_=q#",}])!JAPH!qq(tsuJ[{@"tnirp}3..0}_$;//::niam/s~=)]3[))_$-3(rellac(=_$({ pam{rekcahbus})(rekcah{lrePbus})(lreP{rehtonabus})!JAPH!qq(rehtona{tsuJbus#; $_=reverse,s+(?<=sub).+q#q!'"qq.\t$&."'!#+sexisexiixesixeseg;y~\n~~dddd;eval -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]