Web Hosting Talk







View Full Version : Help!: PHP/Perl Question


whctrlpanel
09-09-2002, 03:10 PM
Hello,
I was wondering if you could execute some perl code within a PHP script....

In that I need to code in primarily PHP to keep session and also input Perl code like this

<?php
session_start();
?>
#/usr/bin/perl
--perl code--

or something like that....

deadserious
09-09-2002, 03:56 PM
You could just write the perl script and then try calling it like this:

<?php virtual("/path/to/yourperlscript.pl"); ?>

Where ever you wanted it to show up.

I don't think you can do what you are saying though, but I could be wrong. :D

mind21_98
09-09-2002, 07:16 PM
Originally posted by deadserious
You could just write the perl script and then try calling it like this:

<?php virtual("/path/to/yourperlscript.pl"); ?>

Where ever you wanted it to show up.

I don't think you can do what you are saying though, but I could be wrong. :D

I wrote a PHP module for the hell of it that does exactly what he wanted. It had a bunch of functions that corosponded to the actual Perl C library function calls to call functions, etc. The only thing is that it was kinda difficult to compile.

The source should be available at http://msalem.translator.cx/perlinphp.php if anyone's interested. :D