Search code examples
perlcatalyst

Module not found despite being in @INC


Perl is complaining that it can't find a module that is right there in @INC.

Can't locate <module> in @INC (@INC contains etc.)

@INC is set correctly, and the module is right there where it should be. This is a web app running under catalyst, and it runs fine in other installations. Something is funky about this one server setup. I've checked permissions on the files, they are fine.

Any suggestions about what else it could be?

As requested in the comments, adding some more info:

In one of my Catalyst controllers, I am "use"-ing a module external to the Catalyst app: Template::Plugin::I18n. I get the following error:

Can't locate Template::Plugin::I18n in @INC (@INC contains:  
  /webroot/www-dev/sonnet/lib    /usr/local/lib/perl5/5.12.4/BSDPAN
  /usr/local/lib/perl5/site_perl/5.12.4/mach /usr/local/lib/perl5/site_perl/5.12.4
  /usr/local/lib/perl5/5.12.4/mach /usr/local/lib/perl5/5.12.4 . /usr/local) at 
  /webroot/www-dev/sonnet/lib/Sonnet/Controller/Pubs.pm line 647.

The module is found at /webroot/www-dev/sonnet/lib/Template/Plugin/I18n.pm with the same permissions as the rest of the app.


Solution

  • Well, this is embarrassing. I had a stray "require" statement that had quotes around the package name! That was causing the error, even though the statement was unneccessary as well. Too much late night coding. Sorry for the distraction. All your suggestions are much appreciated!