Re: Perl extension for PHP
| From: | George Schlossnagle | Date: | Fri, 09 May 2003 09:34:37 +0000 |
| Subject: | Re: Perl extension for PHP | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-16065@lists.php.net to get a copy of this message | ||
On Thursday, May 8, 2003, at 04:00 PM, Johannes Schlueter wrote:
Hi, I used the last days to have a look at the ext/rpc stuff and it looks like a good way for writing a php-perl-Extension ;-) I also asked the author of the "perl-in-php" Extension if he wants to maintain his Extension any longer but he didn't answer, yet. during the next days/weeks/months I'll create a new Perl-Extension, based upon my old one and, maybe, parts of perl-in-php and the ext/rpc-skeleton.If you're interested in a hand - I'd be happy to help. Just to share my ideas on how I would see this working (on php5 primarily). You create a perl interpreter object with $p = new Perl; Then you can use/require files by $p->require("Foo::Bar"); or eval code with $p->eval("code"); but the real workhorse functionality would be through a method call overloader so that you could say $retval = $p->myperlfunc($a,$b); where myperlfunc is a perl subroutine that you have seen in a require/use/eval. (and of course $a, $b, and $retval are php variables auto converted to and from perl types as needed). Possibly also Perl object handling. $obj = $p->new('Foo::Baz'); $retval = $obj->method() (same as $obj->method in Perl) and $retval = $obj->method (sam as $obj->{method} in Perl) In php5 at least, these goals should not be terribly difficult to achieve. George