Forum Moderators: coopster

Message Too Old, No Replies

Running perl script using php passthru

format for executing a perl script and passing parameters with php passthru

         

Jeff_H

10:07 pm on Mar 19, 2004 (gmt 0)

10+ Year Member



I've been try to do something fairly straightforward, but am unable to accomplish it. I want to run script.pl with parameters var1=hello and var2=world (script.pl?var1=hello&var2=world), using the php exec() or passthru() command.

So far, I have the following, but I also want it to run using the variables var1 and var2:
passthru("perl script.pl");

I tried these and several variations to no avail:
passthru("perl script.pl '-var1=hello -var2=world'");
passthru("perl script.pl 'var1=hello&var2=world'");
passthru("perl script.pl -var1=hello -var2=world'");

Can anyone tell me what I'm doing wrong?

jatar_k

5:31 pm on Mar 20, 2004 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



have you also tried virtual() [ca3.php.net]?