SPUG:path problems

North, Walter wnorth at state.mt.us
Thu May 22 10:48:33 CDT 2003


Hi all.  At one time I thought I had the envrionment stuff figured out.

Now it appears I have overlooked something.

I have some perl scripts running as a certain user that is the 
controlling user of a s/w package called incontrol by BMC.

All was well, but then with a recent upgrade BMC put perl in
this product.  Unfortunately they do not include assorted modules
which either come with the normal perl release, or I put in from CPAN.

Ok, no problem I thought, so I put in the front of 
$ENV{PATH} $ENV{PERL5LIB} and $ENV{LIBPATH} the locations of my perl, 
and my perl libs.  And they do show up correctly.

I figured this changed the environment for the whole script,
and any children/grandchildren etc and this has proven true
in everything I've done so far.

But when I run system("which perl") it still sees BMC's perl first.
And the behavior of the script confirms it by basically telling
me that it barfs as it tries to run their perl and autoloader
and load POSIX.  It apparently does find the POSIX module but
since it is running bmc's perl it chokes.

Invalid [] range "a-Z" in transliteration operator at
/ctm600em/bmcperl/lib/vars.pm line 17.
Compilation failed in require at /ctm600em/bmcperl/lib/AutoLoader.pm line 3.
BEGIN failed--compilation aborted at /ctm600em/bmcperl/lib/AutoLoader.pm
line 3.
Compilation failed in require at /usr/local/lib/perl5/5.8.0/aix/POSIX.pm
line 5.
BEGIN failed--compilation aborted at /usr/local/lib/perl5/5.8.0/aix/POSIX.pm
line 5.
Compilation failed in require at /site/local/bin/ctm600em_db_backup.pl line
48.
BEGIN failed--compilation aborted at /site/local/bin/ctm600em_db_backup.pl
line 48.

This also happens when I set the PATH from the shell to 
/usr/local/bin:$PATH it shows up correctly but which perl still produces
BMC's perl.

I then tried (this user runs cshell) (setenv PATH "/usr/local/bin:$PATH";
perl myprog;

Same result, it still insists on using the BMC perl and not mine.

It works the same from cron, from itself, and from the shell (cshrc).

I also tried altering the @INC with the same results.

I'm dazed and confused.

Can someone explain to me what I have obviously missed?

Thanks very much

----------------------------------------------------- 
Walter North 406-444-2914 
Operating Systems Programmer 
wnorth at state.mt.us

"UNIX was never designed to keep people from doing stupid things, because
/\\
 that policy would also keep them from doing clever things." 
     (Doug Gwyn)
----------------------------------------------------- 




More information about the spug-list mailing list