in reply to Re: Dumping Compiled Regular Expressions
in thread Dumping Compiled Regular Expressions

Then how does it get blessed at all? Perl will return a run-time error if you try to bless something that's not a reference. Those lines above will print out:
Temp

ie. No 'Regexp'. The string that you could formerly get to by scalar( $re ) is no where to be found, but it still works.

Not only does $re not lose it's value, it's still a valid regex 'reference' (is it truly a reference?) and you can still use it like:

print "Woohoo!\n" if $string =~ $re;   # prints "Woohoo!\n"
  • Comment on Re: Re: Dumping Compiled Regular Expressions