Re: Calling Perl from PHP -- Help --
| From: | Julian Wood | Date: | Tue, 06 Mar 2001 17:43:18 +0000 |
| Subject: | Re: Calling Perl from PHP -- Help -- | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-42784@lists.php.net to get a copy of this message | ||
I think you're looking for passthru (or perhaps system or exec). If your php
is like this:
<?php passthru ("/tmp/hello.pl yay") ?>
and hello.pl is like this:
#!/usr/bin/perl
print 'Args:'.join(' ', @ARGV);
Your web page will read:
Args:yay
You'll probably need to change the method of input (to use @ARGV instead of
<>) on your Porter stemmer program to make it work properly.
J
--
Julian Wood
Multimedia Developer
University of Calgary
on 3/5/01 11:53 PM, Matt Friedman at matt@daart.ca wrote:
> I'm stumped. I've searched all over and can't figure this one out.
>
> I have a perl script that waits for input on the command line. You type in a
> string and it returns a string.
>
> I'd like to be able to this via php, since I can't rewrite the script in php,
> since it's a little over my head.
>
> So, how do I open the perl script in php, send it some input and read the
> output?
>
> Thanks,
> Matt.
>