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

Re: any chance to se PHP incorporated in wml?

On Thu, 1 Apr 1999, Jim Hebert wrote:

>Well, how you implement this largely depends on which pass you'd like php3
>to be. We'll assume that somewhere in the neighborhood of 3 is good, since
>you mention ePerl.

       just after 3rd pass, maybe pass 3a or instead of perl in 3rd

>I have no idea how the php3 interpreter is used/invoked/whatever, but
>let's assume I can just feed it code on the stdin and get results on the
>stdout. *shrug*

       it works just like the perl interpreter.

>open PHP, "|/usr/local/bin/php > /home/me/tmp/php-tmp$$"; # watch for races!
>print PHP <<END_OF_PHP;
>php3 code goes here
>close PHP;
>open PHP, "</home/me/tmp/php-tmp$$";
>print <PHP>;
>close PHP;

       actually, this works! but with one big limitation: i have to
       escape every special character, since php uses the same way of
       variable naming, $variable, as perl.

       that means this:
open PHP, "|/usr/local/bin/php > /home/me/tmp/php-tmp$$"; # watch for races!
print PHP <<END_OF_PHP;

something out of PHP


echo "This line doesn't contain any variables, and it will be
interpreted correctly, even if it's spred over two lines";

$this_variable = "will cause a parse error in PHP, since perl will interpret";
$another_line = "the dollar signs and PHP will get just  this_variable";

\$but_this_variable = "will be interpreted correctly even in PHP";
\$line_2 = "because perl will deliver the dollar sign";


Out of PHP, again

close PHP;
open PHP, "</home/me/tmp/php-tmp$$";
print <PHP>;
close PHP;

       so.... can i somehow tell to the perl 'dont interpret
       anything, just deliver it to the PHP, it will do the rest'?

Davor Cengija
Doktore, malo sam neodlučan... a možda i nisam...

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