Jump to content

PERL/CGI & PHP include


vietboy505

Recommended Posts

I want to include a PHP file inside a PERL file..

script1.pl
[code]
#!/usr/local/bin/perl

use strict;
use warnings;
use CGI qw(:standard);
use CGI::Carp qw(fatalsToBrowser warningsToBrowser);

print header();
warningsToBrowser(1);

print("<?php include('require_file.php') ?>\n\n");
[/code]

It's in the source code, but it's never include my other php. How can I fixed that?
'require_file.php' is in the same directory the script1.pl is.
Link to comment
Share on other sites

I try [a href=\"http://www.htmlgoodies.com/beyond/webmaster/article.php/3473341\" target=\"_blank\"]this link[/a], when I try in .pl file, it doesn't do nothing.
I also read this link, [a href=\"http://www.zend.com/php5/articles/php5-perl.php?article=php5-perl&kind=php5&id=6290&open=1&anc=0&view=1#Heading3\" target=\"_blank\"]PERL in PHP[/a]

[code]
<?php

    print "Hello from PHP!\n";
    $perl = new Perl();
    $perl->require("script1.pl");
    print "Bye!\n";

    ?>
[/code]
Give me this:

Hello from PHP!
Fatal error: Class 'Perl' not found in C:\Inetpub\webaps\test2.php on line 4

I try include inside PHP script inside PERL script, doesn't work, so I try the PHP include of PERL file. No luck at all.

Do I need to import Perl class from PHP or something?
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.