[ale] [OT] export inside perl

John Wells jb at sourceillustrated.com
Wed Oct 23 07:22:42 EDT 2002


If it is indeed a shell script that's calling the perl, a way to do this
would be to write the export strings to a tmp file from the perl script,
say /tmp/my.exports, and then use source or . syntax to source them into
the calling script's shell after the perl script executes. It'd look
something like:

#!/bin/bash

# output the exports file
/mypath/myperlscript

# source it in
source /tmp/my.exports
<other stuff here...>

or

#!/bin/bash

# output the exports file
/mypath/myperlscript

# source it in
. /tmp/my.exports
<other stuff here...>

John




Geoffrey said:
>
>
> Elanchezhian Sivanandam wrote:
>> hi,
>>        i did export some values inside perl (using shell command
>> "export") but didn't get reflected in the shell after execution of the
>>  script. How to do it???
>
> If you're expecting the exported values to be available to the shell
> script calling the perl script, it won't happen.  The script calling
> your perl script is the parent.  parent processes do not have access to
> the child processes environment once the child process dies.  You would
> have to explicitly open up a communication between the processes in
> order to pass that information to the parent.
>
> You might consider returning the values from the perl script to the
> calling script.
>
>>
>> thanks
>>
>
> --
> Until later: Geoffrey		esoteric at 3times25.net
>
> I didn't have to buy my radio from a specific company to listen
> to FM, why doesn't that apply to the Internet (anymore...)?
>
>
> ---
> This message has been sent through the ALE general discussion list. See
> http://www.ale.org/mailing-lists.shtml for more info. Problems should be
>  sent to listmaster at ale dot org.




---
This message has been sent through the ALE general discussion list.
See http://www.ale.org/mailing-lists.shtml for more info. Problems should be 
sent to listmaster at ale dot org.






More information about the Ale mailing list