Ronald Yacketta wrote: > > From: [EMAIL PROTECTED] > > > > Look at the -i flag. It takes an optional argument, but it sounds like > > you don't want to keep a backup so use it without the arg. Think about > > it carefully. And test > > **VERY** carefully. If you get your code wrong, you've > > messed it up for good. Keep backups. This is a very > > *powerful* statement. In the right hands it's very good, > > else it's very bad > > > > Something like this might work. > > > > perl -e s/_VALUETEST/_QAP2/g -i original.scr > > Would I be able to use this inline? That is within a perl script itself? > If so, might you provide an example?
Yes, modified from my post <[EMAIL PROTECTED]> on Tuesday: use Fatal qw(open close); { local $^I = ''; # in-place edit - no back-up #local $^I = '.bak'; # in-place edit - with back-up file local @ARGV = glob '*.scr'; # put the appropiate file names into @ARGV while ( <> ) { s/_VALUETEST/_QAP2/g; print; } } John -- use Perl; program fulfillment -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]