well, there it is then.. its not a 'child' its a peer..Flexvault is mistaken. It's a child, and it does inherit environment variables. Here are a couple of linux scripts that demonstrate this. First, /tmp/myenv just prints any environment variables that have 'MY' in the name:
Then the main script, which 'opens' myenv:#!/usr/bin/perl print "$_=>$ENV{$_}\n" for grep /MY/, sort keys %ENV;
Running this gives:#!/usr/bin/perl $ENV{MYA} = 'a'; $ENV{MYB} = 'b'; $ENV{C} = 'c'; open(CMD, "/tmp/myenv 2>&1 |") or die "open: $!\n"; while (<CMD>) { chomp; print "got: <$_>\n"; }
got: <MYA=>a> got: <MYB=>b>
Dave.
In reply to Re^3: passing env{} variable to child fails on linux,works on windows
by dave_the_m
in thread passing env{} variable to child fails on linux,works on windows
by sdetweil
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |