Running perl module from PHP <--- HOWTO
Moderator: General Moderators
-
rustyambrose
- Forum Newbie
- Posts: 2
- Joined: Sat Sep 13, 2003 2:28 pm
- Location: Boise, ID
Running perl module from PHP <--- HOWTO
I would like to run a perl module from a php page, using variables from the php page in the module, then needing a set variable from the module used back in the php. What is the best way to do this?
- scorphus
- Forum Regular
- Posts: 589
- Joined: Fri May 09, 2003 11:53 pm
- Location: Belo Horizonte, Brazil
- Contact:
I don't know much of Perl but I belive you can do something like this:
cgi_module.pl:
yourpage.php:
output:
Take a look to the Execution Operators.
Hope it helps!
Regards,
Scorphus.
cgi_module.pl:
Code: Select all
#!/usr/bin/perl
# treat arguments here...
# ...
# the print the significant data to PHP
print "This data was returned from the Perl script";Code: Select all
<?php
$php_var = 'something';
$var_set_from_perl = `./cgi_module.pl $php_var`;// $php_var is the argument to the *executable* Perl script
echo 'The Perl script returned: ' . $var_set_from_perl;
?>Code: Select all
The Perl script returned: This data was returned from the Perl scriptHope it helps!
Regards,
Scorphus.
-
rustyambrose
- Forum Newbie
- Posts: 2
- Joined: Sat Sep 13, 2003 2:28 pm
- Location: Boise, ID