|We don't bite newbies here... much|
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.
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.