in reply to has it been blessed?
If you want to find out if an object is blessed and is
a particular class, you would do something like this:
if ( UNIVERSAL::isa( $obj, 'Class::I::am::checking::for' )){ $obj->invoke_method(); }
If you want to know if it is blessed into any old class
at all, you could do something like this:
my $ref = ref($obj); if ( $ref && ($ref !~ /^(SCALAR|HASH|ARRAY)$/) ) { $obj->invoke_method(); }
|
---|
Replies are listed 'Best First'. | |
---|---|
(tye)Re: has it been blessed?
by tye (Sage) on Mar 06, 2002 at 16:30 UTC | |
Re: Re: has it been blessed?
by rjray (Chaplain) on Mar 06, 2002 at 21:33 UTC | |
by chipmunk (Parson) on Mar 07, 2002 at 02:10 UTC | |
by rjray (Chaplain) on Mar 07, 2002 at 20:35 UTC | |
by dragonchild (Archbishop) on Mar 07, 2002 at 20:44 UTC | |
by rjray (Chaplain) on Mar 07, 2002 at 21:54 UTC | |
| |
by chipmunk (Parson) on Mar 08, 2002 at 05:21 UTC |