perl -p -i.bak -e 's/\$Log/\$History/gi' *
Creates backupfiles with the extension .ext and modifies the original files where all occurances of $Log are replaced with $History.
This is done for every file in this case since you choice *.
$InputArray is a scalar not an Array.
To replace any occurance of $Log to $History: try this but on a backup please.
the first argument is the dir where the files life.
#!/usr/bin/perl
use File::Find;
my @dirs = @ARGV;
@ARGV = ();
File::Find::find(
{
wanted => sub { push @ARGV, $File::Find::name if -f }
},
@dirs
);
local $^I;
while ( defined( $_ = <ARGV> ) ) {
s/\$Log:/\$History:/gi;
print;
}
|