in reply to Editing files in a module

Chargrill is definitely correct. I do that very thing from time to time while developing.

But, please also consider that editing the module directly may be the wrong approach — unless you intend to release patches to the module maintainer. Otherwise, the next time you install a new version of Module, you'll have to make all your changes all over again.

package BetterApproach; use strict; use warings; use Module; use base qw(Module); sub extended_function { my $self = shift; if( $something ) { # new stuff return $new_stuff } $self->SUPER::extended_function(@_); # old stuff }

-Paul

Replies are listed 'Best First'.
Re^2: Editing files in a module
by EvanK (Chaplain) on Dec 18, 2006 at 16:53 UTC
    and if you can't submit your improvements to the original module's author or if your modifications dont fit with the intent of the original, rewrite the module in question under a subsequent namespace (making sure to credit the original module and author, especially if you're largely including any of their code).

    ie: if the original module was App::Functionality, name your modified module App::Functionality::Extra

    __________
    The trouble with having an open mind, of course, is that people will insist on coming along and trying to put things in it.
    - Terry Pratchett