in reply to using Sub::Install to override a module method that cannot be edited

If you want to override the function in the base module (class), then you'd need to form an IS-A relationship with the parent using something like use base 'My::Parent';, then you'd re-implement the function in question to override it in the child class. You'd then use that child class instead of the parent when needing the new function. To refer back to the old function from the parent within the child, you'd use the namespace "SUPER::". For example, the following override's the base class's instantiation function, My::Parent::new() ...
package My::Child; use strict; use base 'My::Parent'; sub new { my $pkg = shift; my $self = $pkg->SUPER::new(@_); # call's My::Parent::new # .. add new fields, do additional things.. return $self; } 1;

Replies are listed 'Best First'.
Re^2: using Sub::Install to override a module method that cannot be edited
by Anonymous Monk on Oct 07, 2007 at 04:05 UTC
    I do not want to do sub classing in the OO sense. I just want to override in a non-OO module