Subject: | Catalyst::ScriptRunner doesn't load "lib" directory to @INC anymore |
Trying to start "./script/<myapp>_server.pl" (even a freshly
bootstrapped one), results in "Can't locate MyApp.pm in @INC". Solution
is simple to run "perl -I lib ./script/<myapp>_server.pl" but it's
quite inconvenient (at least to me) and beginners reading the manuel
certainly won't be happy to see an error message on startup.
Here's what I found:
As the Changelog sais: "The Catalyst::Utils::home function is used to
find if the application is a checkout in Catalyst::ScriptRunner".
in sub "run" (lines 38-39) 5.90007 sais:
if (my $home = Catalyst::Utils::home($appclass)) {
lib->import(File::Spec->catdir($home, 'lib'));
}
whereas it's been like this in 5.90007 (w/o if-clause):
lib->import(File::Spec->catdir($FindBin::Bin, '..', 'lib'));
Catalyst::Utils::home seems to look at %INC returning undef for MyApp
which results in lib->import(..) not beging called. Look like a
loophole for me because Catalyst::Utils::home($appname) will not return
anything unless lib->import(File::Spec->catdir($home, 'lib')) has been
called (or -I lib was specified to the perl interpreter).
So if this is desired behaviour, it should clearly go to the docs. But
I certainly don't like it (having to rewrite lots of startup scripts)
the way it is.
The situation above applies to both my WinXP/64 (perl 5.12) and
Linux/64 (perl 5.10) dev boxes.