in reply to Re: •Re: Re: Say no to ref $thing eq "Expected::Type"
in thread Putting file contents into a scalar
If I want to create a wrapper class that delegates rather than inherits, my class @ISA-not {grin} your precious IO::File, even though I'm using one internally, and delegating everything.
So, please, don't check isa. It's not the right thing to do for maximum re-usability.
I'd say that I could probably override UNIVERSAL::isa to report that "yes, I am in fact a IO::File". However, the most common idiom these days for determining "isa" is not with a method call, because that fails on non-blessed references. {sigh}
-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: •Re: Re: •Re: Re: Say no to ref $thing eq "Expected::Type"
by rir (Vicar) on Oct 30, 2002 at 05:25 UTC | |
by merlyn (Sage) on Oct 30, 2002 at 06:55 UTC | |
by dws (Chancellor) on Oct 30, 2002 at 07:39 UTC | |
by Aristotle (Chancellor) on Oct 30, 2002 at 13:05 UTC | |
by Anonymous Monk on Oct 30, 2002 at 08:45 UTC | |
by rir (Vicar) on Oct 30, 2002 at 19:15 UTC |