Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re^2: Word replace - notetab light vs perl

by kiat (Vicar)
on Oct 06, 2005 at 15:02 UTC ( [id://497954]=note: print w/replies, xml ) Need Help??


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 +');

Replies are listed 'Best First'.
Re^3: Word replace - notetab light vs perl
by Courage (Parson) on Oct 06, 2005 at 18:18 UTC
    yes, you're fast to learn. :)
    regular expressions were speed-optimized a lot. Do RTFS a bit, and you'll have an idea on what I have in mind.

    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.

    Best regards,
    Courage, the Cowardly Dog

      Ilya has that general effect. :-)

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://497954]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2024-12-09 11:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which IDE have you been most impressed by?













    Results (53 votes). Check out past polls.