[Catalyst] Scripts and @INC

Stuart Watt swatt at infobal.com
Wed Feb 24 15:33:15 GMT 2010

Does anybody know if there any very good reason why the fastcgi.pl (and =

other) scripts move the application's lib folder to the front of @INC =

even if it is already in @INC but not at the front? I've just noticed =

that my carefully constructed path is being trampled. I depend on =

occasionally overriding the main application's lib folder with =

site-specific stuff, and I cannot do that with the current scripts.

This is a workaround until we get certain old parts of the app ported to =

Moose, but would it not be more appropriate to only add the library on =

@INC if it is not there already.

The line concerned seems to be in ScriptRunner.pm

    lib->import(File::Spec->catdir($FindBin::Bin, '..', 'lib'));

Would this be better along the lines of:

    my $path =3D File::Spec->catdir($FindBin::Bin, '..', 'lib');
    unless (grep { $path eq File::Spec->rel2abs($_) } @INC) {

This is not tested, but seems the kind of intent needed. Any thoughts, =

feedback, alternative solutions welcome.

-- =

Stuart Watt
ARM Product Developer
Information Balance
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.scsys.co.uk/pipermail/catalyst/attachments/20100224/dd934=

More information about the Catalyst mailing list