Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Editing files in a module

by jettero (Monsignor)
on Dec 18, 2006 at 16:41 UTC ( [id://590481]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://590481]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others surveying the Monastery: (3)
As of 2024-04-20 16:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found