Welcome to the Monastery | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
You can do this with a little cooperation between different processes. Consider the following:
The idea is that prog1 writes valid shell commands to the env.sh file, does whatever else it has to do and then exits. Execution flow returns to the outer shell, which then sources the file that it wrote. The prog2 program then runs, and picks up what ever environment changes were made by env.sh. This is rather fragile and insecure. If you are brave and insist on this approach you really should consider using IPC (Inter-Process Communication) for a more robust solution. The idea is to create a channel of communication (child writes, parent reads) between the two. See perlipc for more information. • another intruder with the mooring in the heart of the Perl In reply to Re: Can I do this ???
by grinder
|
|