Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

call env shell script from perl

by bhagperl (Novice)
on Nov 21, 2011 at 06:56 UTC ( #939135=perlquestion: print w/replies, xml ) Need Help??
bhagperl has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks,

I have shell script which sets env variables.

I want to call this shell script from another perl script, and use those env variables in my perl script.

I am using "source" command for this. and calling with system function in perl as:


And i am trying to access variable "svn" as $ENV{svn} in perl script. but $ENV{svn} returns blank. It is not set.

This is not working !!

Please help me.

Thanks in advance.

Replies are listed 'Best First'.
Re: call env shell script from perl
by Ratazong (Monsignor) on Nov 21, 2011 at 07:05 UTC

    This won't work. This post by Eliya explains you why - and provides a workaround.

    HTH, Rata
      Thanks Ratazong !! Have nice day!!
Re: call env shell script from perl
by Corion (Pope) on Nov 21, 2011 at 07:14 UTC
      Thanks Corion !! Have nice day!!

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://939135]
Approved by planetscape
[Corion]: LanX: Broken links in what sense?
[Discipulus]: neurocent goes always up with the same curve of population raise
[marto]: believe in derp coin
[Corion]: Oh - I see ...
[LanX]: like http://cb60. 1215217
[Discipulus]: username links i bet
[Corion]: (also, let me recommend https://mini-cb60. over that, as it has https :)
[LanX]: all links
[Corion]: I guess I should make the certificate valid for both hostnames
[LanX]: and broken links ;p

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (8)
As of 2018-05-25 15:58 GMT
Find Nodes?
    Voting Booth?