|
use File::Basename;
$prog = basename(replacebegin:content:replaceend);
if($#ARGV < 0)
{
die "\nUsage:\t$prog \n\neg.\t$prog 11111111 00111111\n\n";
}
$filename = $ARGV[0];
$oldpattern = $ARGV[1];
$newpattern = $ARGV[2];
$buf = "";
open(inhandle,$filename);
while()
{
s/$oldpattern/$newpattern/gi;
$buf .= $_;
}
close(inhandle);
print $buf;
open(outhandle,">$filename");
print outhandle $buf;
close(outhandle);
|
|