note
demerphq
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...
<ul>
You can mess with the internals : something like
<code>
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;
}
</code>
Without looking at the internals, I don't have an answer.
</ul>
Thanks Rafael!
<P>
Yves / DeMerphq<br>
--- <BR>
Writing a good benchmark isnt as easy as it might look.
161902
161902