Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number

Re: How do I set env. Variables from Perl with shell script

by moritz (Cardinal)
on May 04, 2009 at 12:09 UTC ( [id://761706]=note: print w/replies, xml ) Need Help??

in reply to How do I set env. Variables from Perl with shell script

Well, you can't (easily). Environment variables are only inherited to sub processes, not to the parent process.

So you have to call first, and then run the perl script. If you want to do it from within perl, you can try something along this lines:

unless ($ENV{INCLUDE}){ exec("; $^X $0 @ARGV"); }

(update: added missing quote, shmem++)

Log In?

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

How do I use this?Last hourOther CB clients
Other Users?
Others admiring the Monastery: (4)
As of 2024-06-20 02:26 GMT
Find Nodes?
    Voting Booth?

    No recent polls found

    erzuuli‥ 🛈The London Perl and Raku Workshop takes place on 26th Oct 2024. If your company depends on Perl, please consider sponsoring and/or attending.