in reply to Re: Wrong + Right = Even Worse
in thread Wrong + Right = Even Worse

You can also put a coderref-hook in front of @INC to catch and redirect all do and require.

Not "all". It won't catch a require for an already-loaded module.

- tye        

  • Comment on Re^2: Wrong + Right = Even Worse (@INC sub)

Replies are listed 'Best First'.
Re^3: Wrong + Right = Even Worse (@INC sub)
by LanX (Saint) on Apr 04, 2014 at 16:08 UTC
    One would need a private shadow %MY_INC within the catch-sub to handle it and keeping %INC clean.

    I'm aware this would cause problems with code accessing %INC directly, but I somehow doubt this legacy code base ever attempts to do such things.

    IMHO good enough for debugging.

    Cheers Rolf

    ( addicted to the Perl Programming Language)