in reply to Re: How to tell if a variable is blessed ?
in thread How to tell if a variable is blessed ?
A better answer may be Scalar::Util and blessed.
$scalar = "foo"; $class = blessed $scalar; # undef $ref = []; $class = blessed $ref; # undef $obj = bless [], "Foo"; $class = blessed $obj; # "Foo"
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: How to tell if a variable is blessed ?
by linux454 (Pilgrim) on Mar 02, 2006 at 15:13 UTC | |
by Fletch (Bishop) on Mar 02, 2006 at 15:17 UTC | |
by xdg (Monsignor) on Mar 02, 2006 at 15:34 UTC | |
by jasonk (Parson) on Mar 02, 2006 at 19:14 UTC |