Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re^2: Dancer2: Why is bundled 'lib/' required?

by kcott (Archbishop)
on Feb 02, 2022 at 03:49 UTC ( [id://11141047]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11141047]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2024-04-18 00:04 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found