in reply to Re: Re: OO Perl: calling a constructor within a class
in thread OO Perl: calling a constructor within a class
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')) {
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Re: Re: Re: OO Perl: calling a constructor within a class
by runrig (Abbot) on Sep 26, 2001 at 22:35 UTC | |
by tye (Sage) on Sep 27, 2001 at 21:32 UTC |