im quite new to php and i have no idea how to do this.
in the context of my problem, i have basic calculator written in perl with 4 operators + - * /. 2 txt fields (first number seocnd number) and a drop down menu (with the 4 operators as options) are displayed on a webpage and when the user clicks calculate it will bring up a new page with the answer(assuming the the input is valid).
i need to write a peice of code in php the will test the perl script (i.e each operator using valid input) to see if it functions. im guessing i will need to pass arguments to the script in order to do this but i really am stuck on how to do this.
any help to get me started or more would be much appreciated.
thanks
help needed: passing arguments to a test a perl script
Moderator: General Moderators
-
TheBentinel.com
- Forum Contributor
- Posts: 282
- Joined: Wed Mar 10, 2004 1:52 pm
- Location: Columbus, Ohio
Re: help needed: passing arguments to a test a perl script
How about using file_get_contents?sh33p1985 wrote: i need to write a peice of code in php the will test the perl script (i.e each operator using valid input) to see if it functions. im guessing i will need to pass arguments to the script in order to do this but i really am stuck on how to do this.
$output = file_get_contents("http://yourserver.com/calc.pl?operator= ... perand2=20");
print ($output); // should print 35
You could randomize the operands or just have a series of these to run your tests.
Is that the kind of thing you're looking for, or have I missed your point?