http://qs321.pair.com?node_id=11141032


in reply to Dancer2: Why is bundled 'lib/' required?

Isn't it just a matter of finding out where make install installed Private::Work::Module from its output? And then check apache's INC and yours. If all else fails, bin/app.psgi tries to find required modules with this: use lib "$FindBin::Bin/../lib";

Replies are listed 'Best First'.
Re^2: Dancer2: Why is bundled 'lib/' required?
by kcott (Archbishop) on Feb 02, 2022 at 03:49 UTC

    G'day bliako,

    Both Private::Work::Module and Private::OtherWork::OtherModule are in the same "@INC" directory. Dancer2 finds the latter but not the former. Why would it find one but not the other?

    I thought you might be on to something with FindBin but a few tests indicate that's not the case. If /path/to/bin/../lib doesn't exist, it still gets prepended to @INC. Having a non-existent directory in @INC does not cause Perl any problems.

    $ alias perle alias perle='perl -Mstrict -Mwarnings -Mautodie=:all -MCarp::Always -E +' $ ls -al /home/ken/tmp/zxc/bin/../lib ls: cannot access '/home/ken/tmp/zxc/bin/../lib': No such file or dire +ctory ken@titan ~/tmp/zxc/bin $ perle 'use FindBin; use lib "$FindBin::Bin/../lib"; use JSON; say $J +SON::VERSION; say $INC{"JSON.pm"}; say for @INC;' 4.03 /home/ken/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/JSON.p +m /home/ken/tmp/zxc/bin/../lib /home/ken/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0/cygwin +-thread-multi /home/ken/perl5/perlbrew/perls/perl-5.34.0/lib/site_perl/5.34.0 ...

    Thanks for the suggestions anyway.

    — Ken