in reply to Need help using fatpack

Issue 1

The file produced by fatpack installs a hook into the mechanism used by use/require/do. As such, fatpack can only package files which are loaded using use/require/do. It presumes that .pm are loaded this way, but it presumes that .al files aren't loaded that way. Thus the error.

The .al files are probably Perl subs that are autoloaded (read from disk, compiled and executed when called). If so, it's possible that use/require/do is used to load them. And if that is so, it becomes an issue of convincing fatpack to treat .al files as .pm. It might already do that; the message might just be warning that things might not work.

If they're not loaded using use/require/do, fatpack can't help you. The module won't be able to find these files when it looks for them.


Issue 2

fatpack relies on .packlist files created for installed modules. You could create one.

Replies are listed 'Best First'.
Re^2: Need help using fatpack
by ibm1620 (Hermit) on Apr 30, 2022 at 00:50 UTC
    Re: Issue 2 --
    fatpack relies on .packlist files created for installed modules. You could create one.
    Well, not me :-) I created this:

    /Users/chap/private/perl/.packlist:

    /Users/chap/private/perl/CLH_Utils.pm
    and then ran fatpack pack, but the module was not placed in fatlib/, nor was it added to myprog.packed.pl.

    Can always send CLH_Utils.pm in addition to myprog.packed.pl and say "put these in the same directory" but a clean solution would be preferable.

      That file name looks wrong. Not sure what it looks for, but it's always in auto in an directory in @INC. Maybe auto/CLH_Utils/.packlist?

Re^2: Need help using fatpack
by ibm1620 (Hermit) on Apr 29, 2022 at 18:55 UTC
    My code doesn't directly reference those .al files; it doesn't even directly use Term::ReadLine::Gnu (which isn't allowed anyway). All my code does is use Term::ReadLine and somehow it chooses ::Gnu (rather than ::Perl or ::Stub).

    So near as I can gather, what you describe is all handled by the ::Gnu version of ReadLine.

    But it doesn't seem to matter. I copied myprog.packed.pl and CLH_Utils.pm to a virginal user on a MacOS Catalina with Perl 5.18 and it ran okay, apparently falling back to Term::ReadLine::Perl.