in reply to (tye)Re: ref, no, maybe?
in thread ref, no, maybe?
I've always used variations of:
with great success. It may not catch everything, and normally I'm not hunting around to figure out what's in a variable... If you don't know, you're in bigger trouble than this. :)if ($type = ref $t) { eval { $t->isa("UNIVERSAL"); }; if ( $@=~/unblessed/ ) { print "It's a $type, not blessed.\n" } else { print "It's blessed into class $type"; } } else { print "Not a reference at all\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
can in Re: ref, no, maybe?
by jeroenes (Priest) on Jan 11, 2001 at 14:04 UTC | |
by tye (Sage) on Jan 11, 2001 at 19:35 UTC | |
|
(tye)Re2: ref, no, maybe?
by tye (Sage) on Jan 11, 2001 at 05:45 UTC |