Re: Perl extension for PHP
| From: | George Schlossnagle | Date: | Fri, 09 May 2003 10:31:57 +0000 |
| Subject: | Re: Perl extension for PHP | ||
| References: | 1 | Groups: | php.pear.dev |
| Request: | Send a blank email to pear-dev+get-16067@lists.php.net to get a copy of this message | ||
Very nice. Seems it could use a bit of updating, but is very much the heart of how I think it should run.
On Friday, May 9, 2003, at 06:23 AM, Thies C. Arntzen wrote:
you may want to look athttp://www.apache.org/~dougm/php-perl.tar.gzwhich is something Doug MacEachern has written some time ago.On Fri, May 09, 2003 at 05:34:37AM -0400, George Schlossnagle wrote:On Thursday, May 8, 2003, at 04:00 PM, Johannes Schlueter wrote:-- Thies C. Arntzen - Looking for all sorts of freelance work - just ask.. http://www.amazon.de/exec/obidos/wishlist/AB9DY62QWDSZ -- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.phpHi, 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 -- PEAR Development Mailing List (http://pear.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php