Syntactic Confectionery Delight | |
PerlMonks |
Re: Unix Aliases?by pelagic (Priest) |
on Sep 07, 2004 at 10:50 UTC ( [id://388984]=note: print w/replies, xml ) | Need Help?? |
We had this requirement also and "invented" the following: This solution is assuming to find the file $profile in the PATH of the caller. Added some explanation: Let's say we got a shell script called "my_env" that might look something like: We would then call our sub like: getenv would execute my_env in a shell. The second command "env" would create output like: These will be written into @envlines and then be set into the running Perl script's environment. Removed parameter of "my_env" that was actually not used in this example. pelagic
In Section
Seekers of Perl Wisdom
|
|