Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

dankogai (3580)

  (email not shown publicly)

Journal of dankogai (3580)

Saturday April 01, 2006
02:23 AM


[ #29171 ]

Not only perl hackers but also the rest of hackers seem to make too much fun of PHP. That was so true that in YAPC::Asia even Matz and Larry was making fun of that (well, Larry made fun of every computer languages including perl but PHP part was the most horrendous).

I felt sorry for PHP folks so I came up with this. Ingy's Module::Compile made it so spiffy.

use strict;
use warnings;
use Inline::PHP;
<?php echo "Hello, PHP\n" ?>
no Inline::PHP;
print "Hello, rest of the world!\n";


Hello, PHP!
Hello, rest of the world!

And here is the module.

package Inline::PHP;
use 5.008001;
use strict;
use warnings;
our $VERSION = '0.01';
use Module::Compile -base;
sub pmc_compile {
    my ($class, $html) = @_;
    $html =~ s/no\s+$class\s*.*;\n//o;
    open my $php, "|-" or exec 'php' or die $!;
    print {$php} $html;
    close $html;
    return q();

<?php echo "Enjoy!" ?>

Dan the Lambdaorz

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • Larry is funny, but sectarianism isn't funny. How can we make sectarianism funny? Anyway. Thanks to Dan for non-sectarianism in the area of computer languages. Dan had this to say about Matz, who spoke at YAPC::Asia this week, in his Japanese blog at [] When you think about the fact that, if there hadn't been ruby, perl might have rested on its laurels, in a sense at this point in time, the perl community's biggest contributor is Matz.