in reply to Exported subroutine redefine

No-one's actually told you what the problem is. In redefine.pm, you redefine module::function. But, when you call function(), you're calling the exported version. Exporter does a glob assignment which is different from a reference. When you assign to the RHS of a glob assignment, the connection is broken.

The proper solution is for redefine to be a facade over module. Bring all of module into redefine, then redefine what you want to change, then everywhere you had "use module", change that to "use redefine".


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Replies are listed 'Best First'.
Re^2: Exported subroutine redefine
by ribasushi (Pilgrim) on Nov 10, 2007 at 19:18 UTC
    Thanks for replying, this is what I figured is happening. What you are suggesting is hard to do, see my other reply