[Date Index][Thread Index]
[Date Prev][Date Next][Thread Prev][Thread Next]

Re: Misterious Behavior of WML calling WML




Ralf S. Engelschall writes:
 > On Thu, Sep 03, 1998, Oliver Paukstadt wrote:
 > 
 > > > foreach $key (keys %ENV) {
 > > >     delete $ENV{$key} if $key ne "PATH";
 > > > }
 > > Yeah, that deletes the ENVIRONMENT of perl, but you  have to start the WML
 > > from that instance of perl.
 > > that would make a call like:(maybe not fully correct quoted)
 > > system("perl -e 'foreach (keys \%ENV){delete \$ENV{\$_} if /^PATH\$/;}
 > > 	system(\"env > test.env\");'");
 > > 
 > > system calls perl calls system, but this doesn't work.
 > > The Problem is, that the 1st wml or eperl needs the Environment and
 > > only the subcalls need a clean environment.
 > > For this level,
 > > system("perl -e '$ENV=(PATH => $ENV{PATH});system(\"env > test.env\");'
 > > should work, too.
 > > 
 > > BUT BOTH SOLUTIONS ARE NOT WORKING!
 > > system forks a new shell with new initalised environemnt-variables, so the
 > > former deletion doesn't have any effect. backticks are not working, too.
 > 
 > Hmmmm... works fine for me (not the % instead of the $):
 > No, it the environment is inherited, so it's ok when you delete
 > %ENV and then call the child. Hmmm... interesting that it doesn't
 > work for you.
 > 

Just a thought - perl's 'system' invokes /bin/sh to do the work, if
there are meta characters in the string passed to system.  Perhaps the
user is setting environment variables in his .profile, but RSE is
not. 

Hence even though the user is cleaning up the environment, the system
call invokes /bin/sh which fills up the environment again. Same thing
happens to RSE, but his .profile is empty (likely if he is a csh user) 
or minimal.

-mac

______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com