Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^2: Do not use UNIVERSAL::isa this way; but why?by brian_d_foy (Abbot) |
on Dec 10, 2008 at 18:03 UTC ( [id://729471]=note: print w/replies, xml ) | Need Help?? |
The problem with $fd->isa(...) is that it crashes if $fd is undef, whereas a simple "no" would be better. If they made that work at the same time as inheritance, that'd be awesome :-) Most likely, that would just be: The idiom is to wrap it in an eval:
If it's not an object or isn't the right type, you get false. It doesn't matter to you why it is false because in both cases it's not the object type you are looking for.
In Section
Seekers of Perl Wisdom
|
|