in reply to Dancer app works until I run it with Plack::Handler::Apache2

G'day LittleJack,

From your post yesterday (Starting out with Dancer and falling at the first hurdle) you're using Dancer2. The link you've provided is for Dancer documentation; the Dancer2 equivalent is https://metacpan.org/dist/Dancer2/view/lib/Dancer2/Manual/Deployment.pod#With-Plack. I had a quick look and can't see any substantial differences; however, it's better to use the right version of the documentation.

"Which perl and which libraries is my Apache (2.4.7) trying to use?"

Either modify your app.psgi, or write a new one, which outputs various version (and perhaps other) information. A very rough, command line example:

$ perl -e ' use List::Util; print "Perl version: $]\n"; print "List::Util version: $List::Util::VERSION\n"; ' Perl version: 5.034000 List::Util version: 1.56

Other suggestions:

Note that I'm attempting to guess what your app.psgi and Apache config look like. Something more concrete from you would be helpful.

— Ken

Replies are listed 'Best First'.
Re^2: Dancer app works until I run it with Plack::Handler::Apache2
by LittleJack (Beadle) on Apr 02, 2022 at 02:39 UTC

    The first version of perldoc which mentions 'pairmap' and 'pairgrep' is for Perl v5.20

    Well that might explain it because my default Perl is still on 5.18.

    But when I check my $List::Util::VERSION it's 1.62 so it should be fine.

    The mystery is somewhat solved when I use Apache2::Status, because Apache is loading some modules from /usr/local/lib/perl/5.18.2/ but some others from /usr/lib/perl/5.18/ where there is indeed an old List::Util.

    How do I convince Apache to load a newer one from a different directory?

        Very helpful, thanks. A rogue startup.pl from another app entirely was to blame.