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

Re: Running WML from WML?



On Sat, 8 May 1999, Denis Barbier wrote:

> On Wed, 5 May 1999, Stephane Bortzmeyer wrote:
> 
> Ralf, could you explain why ePerl recursive calls are prohibited?
> I think the problem comes from the ``URL <--> real paths'' translation
> which must be performed when server side scripting. Stéphane showed how
> to work around this problem by clearing some environment variables, but
> there must be a better way.

I had this Problem, too (around wml 1.6.7)
I solved it on shell-level.
the Basic-Construct is something like this:
system("unset `env | perl -e 'foreach(grep(!/^PATH=/, <STDIN>)){s/^([^=]*)=.*\$/\$1/igs;print \"\$_\\n\";}' ` ;
cd $Data/$dir ; wml -qs $file"); 
I never optimized it for short writing or anything else, but every
ENV-Variable except PATH is destroyed.
The best should be wrapping the env-destroyer in a var, so the
system-Statement is more readable.
Maybe someone could kill the perl-overhead by rewriting in sed, but when I
was born, perl still existed, so I never had to learn awk & sed. ;-)
And I would guarentee there is a shorter perl-statement by using 
perl -e -p but I did not know this construct when I wrote this.
Maybe it is crazy to start a shell and call perl again before starting
wml, but I think  destroying the env on shellbase is the cleanest of the
dirty solu..., äh, workarounds, because the main eperl still knows it's
own Environment.

BYtE Oli

+++Only users loose drugs....+++++++++++++++++++++++++++++++++++++++++++++
+++oliver@paukstadt.de+++http://www.paukstadt.de/ ++++++++++++++++++++++++
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ 

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