in reply to editing of installed modules, a story of failure

> So, and this is the crux of my query, - am I not permitted to edit any perl module on my own machine?

It's not a good idea, because a future CPAN installation might update it and overwrite your patches.

It's better to copy it to another path before patching and prepend it to @INC.

Salva just explained it recently: Re: How to redefine a modules private function?

To your actual question:

you most probably entered an error while patching. A guess: the compilation fails during requirement and the module never returns the necessary true value.

It's hard to tell tho without more details, but did you make sure the new code compiles?

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery

  • Comment on Re: editing of installed modules, a story of failure

Replies are listed 'Best First'.
Re^2: editing of installed modules, a story of failure
by LanX (Saint) on Mar 25, 2022 at 14:17 UTC
    > A guess: the compilation fails during requirement and the module never returns the necessary true value.

    I've tested this theory by patching Data::Dumper , but it produced accurate errors and not the ones from the OP.

    No problems to undo the changes at the end.

    # --- introduced 'die' before module's end D:\>perl -MData::Dumper -e0 test at C:/Strawberry/perl/lib/Data/Dumper.pm line 852. Compilation failed in require. BEGIN failed--compilation aborted. # --- changed final 1 to 0 D:\>perl -MData::Dumper -e0 Data/Dumper.pm did not return a true value. BEGIN failed--compilation aborted. # --- undid all changes D:\>perl -MData::Dumper -e0 D:\>

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery

Re^2: editing of installed modules, a story of failure
by Anonymous Monk on Mar 25, 2022 at 14:38 UTC

    The cpan client can be configured to apply local patches when it installs a module, preserving them across installations. I do not know whether cpanm or cpanp have this capability. Of course, the patches also have to be maintained, but that's only a problem if the module being patched is under active maintenance.