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

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