Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Has anyone attempted to create a PHP to Perl converter?

by Khen1950fx (Canon)
on Nov 13, 2013 at 13:56 UTC ( #1062386=note: print w/replies, xml ) Need Help??

in reply to Has anyone attempted to create a PHP to Perl converter?

Have you tried PHP::Include?
#!/usr/bin/perl -l use strict; use warnings; use PHP::Include ( DEBUG => 1 ); include_php_vars( '/path/to/deepstructure.php' ); my $file = '/path/to/deepstructure.php'; print $file;
Here's the deepstructure.php:
<?php $structure = array( 'names' => array( 'a' => array( 'alberto', 'antonio'), 'b' => array( 'burro', 'brain')), 'ages' => array( 10, 20, 30, 40), ); $x = 42; ?>

Replies are listed 'Best First'.
Re^2: Has anyone attempted to create a PHP to Perl converter?
by marto (Bishop) on Nov 13, 2013 at 16:03 UTC
    my $file = '/path/to/deepstructure.php'; print $file;

    Why have you done this? It literally does nothing to help. Did you actually try this with some real PHP code and not just a simple set of variable declarations? I don't think you actually know what the code you've posted does, your simply falling back to the DEBUG option to dump the perl the module generates to STDERR.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1062386]
[karlgoethebier]: good morning
[Corion]: Discipulus: Ah, so he's the one getting almost drowned all the time - waterpolo certainly is no sport for me ;)
[karlgoethebier]: Corion: buy enough coke and popcorn...
[marto]: Corion the cinema is a lot more expensive than I remember :P
Discipulus hates the smell of popcorn at cinemas..
[Corion]: marto: Yeah, most of the time, I prefer to watch stuff at home, where we can sit on the couch, order pizza and pause the movie. But for kids,...
[Corion]: ... I think the "cinema experience" is something of its own. But certainly, bringing an USB stick home is much easier ;-D

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2017-07-24 08:20 GMT
Find Nodes?
    Voting Booth?
    I came, I saw, I ...

    Results (348 votes). Check out past polls.