in reply to
Re: Word replace - notetab light vs perl
in thread Word replace - notetab light vs perl
Thanks, Courage :)
Did you mean the following?
use Benchmark;
$start = new Benchmark;
open(FH, "wrongs") or die $!;
open(FH2, ">wrongs2") or die $!;
undef $/;
$lines = <FH>;
$counted2 = $lines =~ s/wrongs/wrongs4/g;
print FH2 "$lines";
$/ = "\n";
close (FH);
close (FH2);
$end = new Benchmark;
# calculate difference
$diff = timediff($end, $start);
print "replaced: $counted2 The operation took: " , timestr($diff, 'all
+');