in reply to Re: Exported subroutine redefine
in thread Exported subroutine redefine

Nice, but... now seeing the big picture and noting that it's not a general "global subroutine override" problem, but just about Carp - what about writing your own version of Carp.pm and including its path in PERL5LIB? Seems much easier and cleaner to me.

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^3: Exported subroutine redefine
by ribasushi (Pilgrim) on Nov 12, 2007 at 07:56 UTC
    Funny but I never thought of that :) So basically bring all the functionality described above plus the subroutines from Carp.pm, call the resulting module Carp.pm and load it from perl5lib while still relying on the original Carp::Heavy. Neat... Well at least I got pretty comfortable with the symbol table along the way :)