Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re^2: Modifying %ENV From The Shebang Line

by ikegami (Patriarch)
on Dec 17, 2007 at 23:43 UTC ( [id://657565]=note: print w/replies, xml ) Need Help??


in reply to Re: Modifying %ENV From The Shebang Line
in thread Modifying %ENV From The Shebang Line

That would need to be wrapped in a BEGIN block since it needs to be executed before a use statement.

Replies are listed 'Best First'.
Re^3: Modifying %ENV From The Shebang Line
by shmem (Chancellor) on Dec 17, 2007 at 23:46 UTC
    Of course, but that would be advanced usage... if you do such bold stuff as loading modules, it would be required, yes ;-)

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
      This is great, I used this to execute the perl installed with Oracle. Oracle is installed under $ORACLE_HOME, which can be set dynamically depending on the Oracle SID.
      #!/usr/bin/perl use strict; use warnings; # Voodoo magic to run under Oracle Perl, for DBI. # See http://www.perlmonks.org/?node_id=657563. BEGIN { die "ORACLE_HOME not set\n" unless $ENV{ORACLE_HOME}; unless ($ENV{OrAcLePeRl}) { $ENV{OrAcLePeRl} = "$ENV{ORACLE_HOME}/perl"; $ENV{PERL5LIB} = "$ENV{PERL5LIB}:$ENV{OrAcLePeRl}/lib:$ENV{OrA +cLePeRl}/lib/site_perl"; $ENV{LD_LIBRARY_PATH} = "$ENV{LD_LIBRARY_PATH}:$ENV{ORACLE_HOM +E}/lib32:$ENV{ORACLE_HOME}/lib"; exec "$ENV{OrAcLePeRl}/bin/perl", $0, @ARGV; } } use DBI; ...

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://657565]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2024-04-19 11:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found