in reply to Exported subroutine redefine
I wrote an all of chapter 10 for Mastering Perl about how to do this (and chapter 4 deals with some fo that Carp stuff tilly mentioned).
I didn't cover the @EXPORT case, though, so maybe I should add that. As others pointed out, you have to export to the calling namespace to overwrite the functions something else exported. The problem is that now you have to use those modules in the right order or you'll get the wrong function (anyone remember the CGI.pm and URL.pm modules fighting it out to see whose url() would be the final one defined?).
See if you can get yourself to the point where you're only using redefine in the code so it loads the module it wants to override, does its work, then expors the final versions of everything. You won't have someone come along and list all of the modules in alphabetical order (yeah, some of us are a bit OCD like that) and screw up everything. :)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Exported subroutine redefine
by ribasushi (Pilgrim) on Nov 11, 2007 at 13:25 UTC | |
by joey (Initiate) on Oct 21, 2008 at 22:04 UTC |