in reply to Re: Word replace - notetab light vs perlin thread Word replace - notetab light vs perl
Did you mean the following?
$start = new Benchmark;
open(FH, "wrongs") or die $!;
open(FH2, ">wrongs2") or die $!;
$lines = <FH>;
$counted2 = $lines =~ s/wrongs/wrongs4/g;
print FH2 "$lines";
$/ = "\n";
$end = new Benchmark;
# calculate difference
$diff = timediff($end, $start);
print "replaced: $counted2 The operation took: " , timestr($diff, 'all
A drawback of such optimization - no-one now can improve that code, because it is highly complicated.
Well, this is not the only place on where perl has good speed abilities.
Courage, the Cowardly Dog
1. Keep it simple
2. Just remember to pull out 3 in the morning
3. A good puzzle will wake me up
Many. I like to torture myself
0. Socks just get in the way
Results (345 votes). Check out past polls.