$class = 'Temp'; $re = qr/test/io; my $regex = bless $re, $class;After that regular expression is blessed, how do I know that it's a regular expression? I'm writing an in-house utility to dump perl objects and references to XML for transfer between some systems.
If I do '<kbd>ref( $re )</kbd>', I get 'Regexp', as I would expect, but when I do '<kbd>ref( $regex )</kbd>', I of course get 'Temp', and when I do '<kbd>scalar( $regex )</kbd>', rather then getting something useful like 'Temp=Regexp(?-ixsm:test)' like I might expect, I get something like 'Temp=SCALAR(0x00000)'. At this point, I have no way of knowing if that's a regular expression or a scalar ref or exactly what, and I thus can't dump it accurately.
Anyone have any clue how to get this information on blessed regular expressions?
For what it's worth, I checked Data::Dumper's output. It gives me something this:
$VAR1 = bless( do{\(my $o = undef)}, 'Temp' );
In reply to Dumping Compiled Regular Expressions by Hrunting
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |