http://www.perlmonks.org?node_id=1206365


in reply to Mojolicious fails to respect @INC

Somewhere, the wrong version of List::Util gets picked up. Maybe there is 1.38 somewhere in @INC and the 1.49 does not get picked up because file system permissions prohibit it.

I recommend trying a simpler approach by reducing the problem and eliminating Mojolicious and Moose and instead running a simple program to find out which file gets loaded and expanding from there until you locate the actual problem. Start out with something like:

#!perl -w use strict; use List::Util; use Data::Dumper; warn List::Util->VERSION; warn $INC{ "List/Util.pm" }; warn Dumper \%INC; warn Dumper \@INC; warn "Perl $^W"; warn "Perl Version $]";

This should point you to the 1.38 version. If it outputs the 1.49 version, then something else updates @INC, or your code is run by a version of Perl that you did not install 1.49 into. Check and correct until you have found the difference between your program, your expectation and the Mojolicious program.

Replies are listed 'Best First'.
Re: Mojolicious fails to respect @INC
by hesco (Deacon) on Jan 01, 2018 at 02:43 UTC

    Thanks, Corion! I had abandoned the `use lib` strategy on an earlier project, to solve some issue which I do not remember at the moment. Rather than running the `mojo generate app` and adapting from there, I did some cut-n-paste from that previous project, and found myself in this mess. Thanks for steering me back to sanity.

    if( $lal && $lol ) { $life++; }
    if( $insurance->rationing() ) { $people->die(); }