Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic

Perl and paths...again :-(

by ricksquatch (Initiate)
on Jan 28, 2013 at 19:57 UTC ( #1015753=perlquestion: print w/replies, xml ) Need Help??
ricksquatch has asked for the wisdom of the Perl Monks concerning the following question:

I've done the SuperSearch, and the reg'lar Google thing, but nothing hss clicked,as of yet. I'm hoping this will get the ball rolling, so to speak.

BEGIN { $ENV{ORACLE_HOME}="/export/home/riedward/oraclient"; $ENV{TNS_ADMIN}="/export/home/riedward/oraclient"; $ENV{NLS_LANG}=""; $ENV{LD_LIBRARY_PATH}="/lib:/usr/lib:/export/home/riedward/oraclient/s +dk:/export/home/riedward/oraclient"; $ENV{PATH}="/usr/bin:/usr/sbin:/usr/lib:/export/home/riedward/oraclien +t"; $ENV{PERL_LOCAL_LIB_ROOT}="/export/home/riedward/perl5"; $ENV{PERL_MB_OPT}="--install_base /export/home/riedward/perl5"; $ENV{PERL_MM_OPT}="INSTALL_BASE=/export/home/riedward/perl5"; $ENV{PERL5LIB}="/export/home/riedward/perlmodules:/export/home/riedwar +d/perl5/lib/perl5/sun4-solaris-64int:/export/home/riedward/perl5/lib/ +perl5"; } use DBI; use DBD::Oracle;
If I set each of the listed env vars in my .profile, all is well. If I don't, and only set them in my script, then I get the dreaded DBD::Oracle error:
Can't load '/export/home/riedward/perlmodules/sun4-solaris-64int/auto/ +DBD/Oracle/' for module DBD::Oracle: perl: fatal: l open failed: No such file or directory at /usr/perl +5/5.8.4/lib/sun4-solaris-64int/ line 230.

I've been messing with this for a while now, so the paths may be a bit convoluted. Any insights are worth beer....

Replies are listed 'Best First'.
Re: Perl and paths...again :-(
by Corion (Pope) on Jan 28, 2013 at 20:05 UTC

    It may be on your OS that $ENV{LD_LIBRARY_PATH} needs to be set before your process is launched. So either set the values and re-exec your program, or set the values from a shell script.

    BEGIN { if(! $ENV{RELAUNCH}) { $ENV{RELAUNCH}=1; $ENV{ORACLE_HOME}="/export/home/riedward/oraclient"; ... exec $0 => @ARGV; }; };
Re: Perl and paths...again :-(
by SuicideJunkie (Vicar) on Jan 28, 2013 at 20:10 UTC

    Perhaps try setting $FMW{...}="..."; instead.


    for my $key (keys %FMW) { print "fmw-$key =\[$FMW{$key}\]\n"; print "env-$key =\[$ENV{$key}\]\n"; print "MISMATCH!\n" if $FMW{$key} ne $ENV{$key}; }
    and compare to see if there are any odd escape characters or encoding issues or whatnot.

Re: Perl and paths...again :-(
by Plankton (Vicar) on Jan 29, 2013 at 06:08 UTC
    Is the on an auto mounted filesystem? If so your problem maybe automounter. update: also do you have the oracle client installed? Does sqlplus work?

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://1015753]
Approved by muba
[tye]: disable /proc and then see what it does?
[davido]: then it reads from /etc/passwd to decide who my uid is.
[davido]: sorry, typed that before you asked me to disable proc
[davido]: but you stumped me; don't know how to disable proc.
[tye]: I don't know if you can just dismount, but I thought so.
[davido]: yeah, umount -f isn't powerful enough.
[tye]: probably something in the init subsystem that does the mounting that you could disable and reboot.
davido needs to close laptop to board flight home from yapc.
[davido]: I'll look into it in a few hours probably.

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2017-06-23 20:03 GMT
Find Nodes?
    Voting Booth?
    How many monitors do you use while coding?

    Results (554 votes). Check out past polls.