Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Identifying if a variable is the product of a qr//

by demerphq (Chancellor)
on Apr 25, 2002 at 14:04 UTC ( #161954=note: print w/ replies, xml ) Need Help??


in reply to Identifying if a variable is the product of a qr//

I got an interesting response about this subject from Rafael Garcia-Suarez about this, he said it was ok to post it so here goes...

    You can mess with the internals : something like
    use B qw/class svref_2object/; sub is_a_precompiled_regexp { my $r = shift; return 0 unless ref $r; my $o = svref_2object $r; return (class($o) eq "PVMG") && ($o->MAGIC->TYPE eq 'r') ? 1 : 0; }
    Without looking at the internals, I don't have an answer.
Thanks Rafael!

Yves / DeMerphq
---
Writing a good benchmark isnt as easy as it might look.


Comment on Re: Identifying if a variable is the product of a qr//
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (7)
As of 2015-07-07 11:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls