Update: For most uses you are probably better off stealing GBARR's solution as posted by jmcnamara in a reply to this node. Thanks jmcnamara and gbarr. :-)
use overload; # required for either # qr// constructs are NOT considered blessed objects. sub blessed($) { (ref($_[0]) && (index(overload::StrVal($_[0]),'=')>=0) && overload::StrVal($_[0])!~/^Regexp=SCALAR/) ? ref($_[0]) : "" } # qr// constructs ARE considered blessed objects sub blessed($) { (ref($_[0]) && (index(overload::StrVal($_[0]),'=')>=0)) ? ref($_[0]) : "" }
|
---|
Replies are listed 'Best First'. | |
---|---|
•Re: blessed
by merlyn (Sage) on Dec 05, 2002 at 16:14 UTC | |
by demerphq (Chancellor) on Dec 05, 2002 at 16:25 UTC | |
by jmcnamara (Monsignor) on Dec 05, 2002 at 16:38 UTC | |
by demerphq (Chancellor) on Dec 05, 2002 at 20:26 UTC | |
by PodMaster (Abbot) on Dec 05, 2002 at 23:40 UTC |