Think about Loose Coupling | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
In general using this code can cause an error, unless you can be sure that if $me is a reference that it is a blessed reference.
It is this that led to people doing if(ref($me) && UNIVERSAL::isa($me,'my_class_name')) { which is ugly, IMO. The Scalar::Util package, that as of 5.7.2 is part of the perl distribution, contains a sub blessed() to get around this if(blessed($me) && $me->isa('my_class_name')) { In reply to Re: Re: Re: OO Perl: calling a constructor within a class
by gbarr
|
|