viffer has asked for the wisdom of the Perl Monks concerning the following question:
I have a strange scenario (ooh missus)...
When logged on as a super user, the only way I can connect to a database is by issuing the unset LIBPATH command before running my script.
I have tried numerous ways to replicate this command within my script such as
but get the error Can't exec "unset": A file or directory in the path name does not exist.1/ $command = 'unset LIBPATH'; system( $command );
and$ENV{LIBPATH} = ""
and$ENV{LIBPATH} = '/usr/lib:/lib:/home/db2inst1/sqllib/lib'
anddelete $ENV{LIBPATH};
andsystem("LIBPATH=/usr/lib:/lib:/home/db2inst1/sqllib/lib; export LIBPAT +H");
Whilst these appear to have set the $ENV{LIBPATH} correctly, I still get the error message$ENV{LIBPATH} = $ENV{ LIBPATH } . ":/lib:/home/db2inst1/sqllib/lib";
The ONLY thing that seems to allow me to connect is running the 'unset LIBPATH' command before I run my script. Now I appreciate that I'm not supplying a whole heap of code here, but I just wonder if anyone has encountered a similar problem wherein they can connect as themselves, but not as a super user unless they have reset the libbath?DBI connect('OLTTST','joltdev',...) failed: Total Environment allocati +on failure! Did you set up your DB2 client environment? at /apps/bin +/modules/jolt.pm line 88 DBI::__ANON__[/usr/opt/perl5/lib/site_perl/5.8.2/aix-thread-mu +lti/DBI.pm:658]('undef','undef') called at /usr/opt/perl5/lib/site_pe +rl/5.8.2/aix-thread-multi/DBI.pm line 660 DBI::connect('DBI','dbi:DB2:OLTTST','joltdev','joltuser') call +ed at /apps/bin/modules/jolt.pm line 88 jolt::connect() called at /apps/bin/optus/reconcile_withdotsh. +pl line 122 jolt::connect(/apps/bin/modules/jolt.pm:91):
To be honest having tried whatever I can think of I haven't a clue!
I'd be grateful if anyone could suggest even the most outlandish resolution. Thanks Kev
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: replicating the command 'unset LIBPATH' in perl
by ikegami (Patriarch) on May 18, 2010 at 04:52 UTC | |
by viffer (Beadle) on May 18, 2010 at 05:03 UTC | |
by ikegami (Patriarch) on May 18, 2010 at 05:57 UTC | |
by viffer (Beadle) on May 18, 2010 at 06:35 UTC | |
by Anonymous Monk on May 18, 2010 at 07:00 UTC | |
|
Back to
Seekers of Perl Wisdom