[EMAIL PROTECTED] (Bill Doucet) wrote:
>
>my ($PATH_LIB)="::lib:";
>
>use lib $PATH_LIB; use OpenSRS::XML_Client; use OPS; use Config;
There's your problem. Try running the following script:
my ($PATH_LIB)="::lib:";
use lib $PATH_LIB;
print "INC: @INC\n";
You'll find that the output doesn't contain "::lib:". Why? Because
'use' always happens at compile time, whereas the variable assignment
doesn't happen until later, at runtime. Therefore the important parts
of the second line happen before the first line.
Later versions of Perl seem to have a mandatory warning about this, as
5.6.0 just complained about the code when I ran it. Nice to know.
One solution:
my $PATH_LIB;
BEGIN {$PATH_LIB="::lib:"}
use lib $PATH_LIB;
print "INC: @INC\n";
But you might as well just use the literal:
use lib "::lib:";
print "INC: @INC\n";
------------------- -------------------
Ken Williams Last Bastion of Euclidity
[EMAIL PROTECTED] The Math Forum