[prog] Calling a perl program from within PHP

Jacinta Richardson jarich at perltraining.com.au
Sat Nov 13 19:05:19 EST 2004



Gareth Anderson wrote:

> "system() is just like the C version of the function in that it
> executes the given command and outputs the result. "
> 
> passthru "This function should be used in place of exec() or system()
> when the output from the Unix command is binary data which needs to be
> passed directly back to the browser."
> 
> "exec() executes the given command, however it does not output anything."
> 
> And then there's this page which has them all listed:
> http://au.php.net/manual/en/ref.exec.php
> 
> And proc_open and other commands whch are more complicated then I need....
> 
> So I believe exec() is not useful for what I'm doing.
> system() should do it.
> passthru() -- not designed for text data, hopefully system will work.

passthru should be fine for text data.  It may be especially good at not 
munging binary data, but text data is just a simple case of binary data. 
  passthru is almost certainly what you want.

All the best,

    Jacinta

-- 
    ("`-''-/").___..--''"`-._          |  Jacinta Richardson         |
     `6_ 6  )   `-.  (     ).`-.__.`)  |  Perl Training Australia    |
     (_Y_.)'  ._   )  `._ `. ``-..-'   |      +61 3 9354 6001        |
   _..`--'_..-_/  /--'_.' ,'           | contact at perltraining.com.au |
  (il),-''  (li),'  ((!.-'             |   www.perltraining.com.au   |




More information about the Programming mailing list