'use lib' considering "standard" sub-directories also?

31/07/2008 - 16:25 von Frank Bergemann | Report spam
this little programm:


cat test.pl


#!/usr/local/bin/perl

BEGIN {
$ORGAROOT=$ENV{'ORGAROOT'};
} # BEGIN

use lib "$ORGAROOT/run/lib/perl5/site_perl";

foreach(@INC){
print "$_";
}

behaves different two systems.
Unfortunately for the two systems i use, there are TWO differences.
System A: SunOS 5.9, perl 5.8.1
System B: SunOS 5.10 perl 5.8.6.

So i can't say, which is the reason for the difference:

But here's the results:

System A > ./test.pl
/nfs/userspace02/frank/buildspace/OPSC_Gold_rte_dev_R1.1.5.12/OPSCGOLD/
run/lib/perl5/site_perl/5.8.1/sun4-solaris
/nfs/userspace02/frank/buildspace/OPSC_Gold_rte_dev_R1.1.5.12/OPSCGOLD/
run/lib/perl5/site_perl/5.8.1
/nfs/userspace02/frank/buildspace/OPSC_Gold_rte_dev_R1.1.5.12/OPSCGOLD/
run/lib/perl5/site_perl
/usr/local/lib/perl5/5.8.1/sun4-solaris
/usr/local/lib/perl5/5.8.1
/usr/local/lib/perl5/site_perl/5.8.1/sun4-solaris
/usr/local/lib/perl5/site_perl/5.8.1
/usr/local/lib/perl5/site_perl/5.8.0/sun4-solaris
/usr/local/lib/perl5/site_perl/5.8.0
/usr/local/lib/perl5/site_perl

System B > ./test.pl
/nfs/userspace02/frank/buildspace/OPSC_Gold_rte_dev_R1.1.5.12/OPSCGOLD/
run/lib/perl5/site_perl
/usr/local/lib/perl5/5.8.6/sun4-solaris
/usr/local/lib/perl5/5.8.6
/usr/local/lib/perl5/site_perl/5.8.6/sun4-solaris
/usr/local/lib/perl5/site_perl/5.8.6
/usr/local/lib/perl5/site_perl

So i miss what i called the "standard" sub-directories on System B.

And i would like perl to resolve the sub-directories itself.
Because i don't want to use additionally explicit

use lib "$ORGAROOT/run/lib/perl5/site_perl/5.8.1";
use lib "$ORGAROOT/run/lib/perl5/site_perl/5.8.1/sun4-solaris";

Because then it will conflict, if i switch to a new version or kind of
system.

The only option i see currently is to dynamically check which sub-
directories and add the results of my check.
But i'd rather prefer the behavior of System A.

Could you please help me?

- many thanks!

rgds
Frank
 

Lesen sie die antworten

#1 Slaven Rezic
02/08/2008 - 07:39 | Warnen spam
Frank Bergemann writes:

[...]

So i miss what i called the "standard" sub-directories on System B.

And i would like perl to resolve the sub-directories itself.
Because i don't want to use additionally explicit

use lib "$ORGAROOT/run/lib/perl5/site_perl/5.8.1";
use lib "$ORGAROOT/run/lib/perl5/site_perl/5.8.1/sun4-solaris";

Because then it will conflict, if i switch to a new version or kind of
system.

The only option i see currently is to dynamically check which sub-
directories and add the results of my check.
But i'd rather prefer the behavior of System A.

Could you please help me?



Nach meiner Beobachtung werden die von dir vermissten
Unterverzeichnisse automatisch zu @INC hinzugefügt, wenn sie
existieren.

Gruß,
Slaven

Slaven Rezic - slaven <at> rezic <dot> de

sf-upload: make batch releases on SourceForge
http://sf-upload.sf.net

Ähnliche fragen