Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Perl and PHP

by tobyink (Abbot)
on Dec 10, 2012 at 22:32 UTC ( #1008175=note: print w/replies, xml ) Need Help??

in reply to Perl and PHP

An embedded Perl interpreter for PHP does exist but it's a pretty bizarro thing to do.

Update: the following works here:

<?php $perl = new Perl(); $perl->eval(<<<'PERL' sub add_two { my $n = shift; return $n + 2; } PERL ); echo "add_two(3) is ... ", $perl->add_two(3), "\n";

Interestingly when running print "$^X $]" in the embedded Perl, I get: /usr/bin/php 5.010001 (that version number happens to correspond to my operating system's pre-packaged version of Perl).

perl -E'sub Monkey::do{say$_,for@_,do{($monkey=[caller(0)]->[3])=~s{::}{ }and$monkey}}"Monkey say"->Monkey::do'

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1008175]
[tye]: How the heck does a web framework get popular when an unexpected exception gets logged as just "Exception" w/ no details?
[RonW]: There have been times when some one has modified my Perl code and decided to "clean up" my error/warning messages for me by adding line terminators
[RonW]: Because the coders using them like them despite the lack of useful error/warning messages

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2017-09-21 20:31 GMT
Find Nodes?
    Voting Booth?
    During the recent solar eclipse, I:

    Results (252 votes). Check out past polls.