in reply to Re: OOP Question - location of $self
in thread OOP Question - location of $self

Passing @_ is not only goofy, but it breaks inheritance. You won't be able to inherit from the class and override other. Consider   other(@_); It is a non-OO invocation. If other doesn't exist in the current class, it won't be searched for using the @ISA chain. You might want to do this to implement "restricted" (callable only within one class) functions, though it requires that all callers know that other is restricted. That can get messy. <p Now consider   $self->other($arg); If other doesn't exist within the calling class, it will be searched via @ISA, which is what you want when you're using inheritance.

Replies are listed 'Best First'.
Re: Re: Re: OOP Question - location of $self
by tye (Sage) on Apr 16, 2001 at 22:09 UTC

    The original discussion was about "internal" routines. Those are not meant to be subject to inheritance. So avoiding inheritance for these routines was the whole point.

            - tye (but my friends call me "Tye")