[Israel.pm] setenv in perl
offer.kaye at gmail.com
Thu Sep 2 06:59:45 PDT 2004
On Thu, 02 Sep 2004 16:16:33 +0300, Shlomi Bakish wrote:
> I'm working on unix platform.
> I have a device that uses a proriety programing language (very limited).
Get your company to switch the device to using Perl (or Tcl) instead
of this propriety language -- Perl is a bit more work to embed, but
very powerful; Tcl is easier to embed, but IMHO not as flexible as
I'm only half kidding, BTW :-)
> I can run a perl script from within the code,
> but the only 2 ways to get back a result, is by reading a file, or
> reading environment variables.
> I don't want to use files for transfering a single result.
> how can I use perl to do setenv ? 'system' seems to use sh, no setenv there.
> Even if I could do setenv, will it still be defined in the parent process ?
In Unix, a process cannot change its parent's environment variables,
so if you're running a Perl script from within your code, and your
programming language doesn't have the equivalent of backticks, then I
guess files are your only way.
Try asking some of the Perl coders you have in Marvell for help -
maybe one of them will have some insight which will help you.
More information about the Perl