Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: Why study SCALAR?

by LunaticLeo (Scribe)
on Dec 26, 2001 at 22:20 UTC ( [id://134450]=note: print w/replies, xml ) Need Help??


in reply to Why study SCALAR?

study() is intended to be used to help optimize regular expressions on the scalar.

I have done benchmarks repeating the same regex on the scalar, and multiple regex's on the same scalar. I have never found a speedup.

BTW, my benchmarks were like:

use Benchmark qw(&cmpthese); $STUDIED_TEXT = $TEXT; study $STUDIED_TEXT; cmpthese($COUNT, { 'with study' => \&fn1, 'w/o study' => \&fn2 } );
Basically, study() is an anachronism. Feel free to ignore it, everybody else does.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://134450]
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: (6)
As of 2024-04-19 16:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found