in reply to (dan2bit) Re: (Ovid) Re: is there a way to check @ISA from upstream?
in thread is there a way to check @ISA from upstream?

Would UNIVERSAL::can help here at all? And perhaps understanding that when you define AUTOLOAD, you should also override can?

-- Randal L. Schwartz, Perl hacker

  • Comment on Re: (dan2bit) Re: (Ovid) Re: is there a way to check @ISA from upstream?

Replies are listed 'Best First'.
Re: Re: (dan2bit) Re: (Ovid) Re: is there a way to check @ISA from upstream?
by dan2bit (Acolyte) on May 10, 2001 at 20:37 UTC
    alas. it would appear that UNIVERSAL::isa and UNIVERSAL::can will not be much help in detecting classes which do not appear in use statements

    use Receipt::TextOnly; print '#output: '.UNIVERSAL::isa('Receipt::TextOnly','Receipt')."\n"; print '#output: '.UNIVERSAL::can('Receipt::TextOnly','render')."\n"; #output: 1 #output: CODE(0x84baf38)

    but

    use Receipt; print '#output: '.UNIVERSAL::isa('Receipt::TextOnly','Receipt')."\n"; print '#output: '.UNIVERSAL::can('Receipt::TextOnly','render')."\n"; #output: #output:
    the second code snippet outputs undef. Back to options 1 or 2.

    {::} =D------an (sometimes the cord just doesn't quite reach)

      I don't know what you mean "do not appear in use statements", so I cannot understand the point you are making.

      Show me the code in Receipt::TextOnly and Receipt, and perhaps I can help add useful behavior here.

      -- Randal L. Schwartz, Perl hacker