[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Missing "use lib;" in *.pl? (1.3.30)



Hi folks,

I accidentally set up the application in such a way that I was starting
it when my current directory was not the ledgersmb root directory, and
was getting errors like "Can't locate lsmb-request.pl in @INC...".
Looking at login.pl for example:

    #!/usr/bin/perl

    use FindBin;
    BEGIN {
      lib->import($FindBin::Bin) unless $ENV{mod_perl}
    }
    require 'lsmb-request.pl';

The intention is to add the directory holding login.pl to perl's include
path, but since "use lib;" is not invoked, the "lib->import..." does
nothing. With "use warnings;" we would see a warning like 'Unquoted
string "lib" may clash with future reserved word at .../login.pl'; by
the way, strangely enough, if "use strict;" is also there, the warning
doesn't appear! (perl-5.16.1 here)

Anyway, adding the "use lib;" made things work, a bit. A remaining
problem is that LedgerSMB::Sysconfig specifies relative paths to some
directories, which are wrong if we didn't start from the root directory.

I later launched the application from the ledgersmb root directory
(1.3.29 in reality), and things started to work correctly.

Best regards,

Luc