Clear questions and runnable code get the best and fastest answer |
|
PerlMonks |
Re: stringified referencesby demerphq (Chancellor) |
on Dec 04, 2002 at 23:51 UTC ( [id://217629]=note: print w/replies, xml ) | Need Help?? |
From what I know you are almost correct. adrianh has the problem but missed* in the turgid docs of perldoc:overload the implication of overload::StrVal which will return the pattern you specify. If that changed an endless chunk of code would break. Including Data::Dumper.
You, or I or someone should post a documentation patch to make it permanent however. Heres a more rigourous definition of a is_blessed test. Incidentally for this check its faster but less idiomatic to say BTW, only if you choose to consider qr// constructs to be blessed then this test is fine. If you dont then you need something like PS: Im hoping that its obvious that you have to use overload; for all of this. Cheers, update:* I didnt mean to imply that he was wrong about the Scalar::Util approach. However it is an extra module and the code I mention should be fine without it. Although it is a lot faster to use than all of the above.
--- demerphq
In Section
Seekers of Perl Wisdom
|
|