The stupid question is the question not asked | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
This seems to a bit of a religious subject, but personally I consider such checks as this to be totally wrong. You probably really want one of the below:
I only consider the first to be really robust, the second is fairly robust but could do the wrong thing if the object was actually a different type but had hash overloading semantics. The third is passable, but is easily fooled into causing errors, and the version you used suffers from all of the problems mentioned for my examples as well as the flaw that it plain and simply can't be used with blessed hashes which IMO is just bad design.
Anyway, you may not agree with my POV here, but if you haven't thought your position through on this type of thing its probably worth doing so.
---
demerphq First they ignore you, then they laugh at you, then they fight you, then you win.
In reply to Re^2: Trouble getting started with Perl OO (ref $f eq 'HASH' is bad)
by demerphq
|
|