Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: RegExps, Prematch and Postmatch without efficiency penalty

by gmax (Abbot)
on Sep 14, 2003 at 10:48 UTC ( [id://291375]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    #!/usr/bin/perl -w
    use strict;
    ...
        substr:  2 wallclock secs ( 2.26 usr +  0.00 sys =  2.26 CPU)
        unpack:  4 wallclock secs ( 3.90 usr +  0.00 sys =  3.90 CPU)
    unpack
    
  2. or download this
    sub prematch {
        unpack sprintf("a%d",$-[0]), $_[0];
    ...
    sub match {
        unpack sprintf ("x%d a%d", $-[0], $+[0] - $-[0] ), $_[0];
    }
    

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (2)
As of 2024-04-24 22:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found