HTML Forms and Perl

jgbishop

Senior member
May 29, 2003
521
0
0
I have a ton of small Perl scripts that I run often. Many of them involve placing text in an input file, running the script, and getting some altered text from an output file. I would like to change to a HTML page to do all of this.

Essentially, I would have two text boxes on the page (one for input and one for output), and I would have a pull-down box with all my Perl scripts in them. Each time I want to run a script, I would simply select the script to run, enter the text in the input box, click a button, and the output text would appear in the output box.

What I want to know is, how can I redirect a perl script to the same form? In other words, I want the post action for my form to be a perl script, which returns some text to the same form. Does anyone know how I could achieve this? I'm afraid JavaScript just won't do for some of the stuff I'm doing...
 

Wizkid

Platinum Member
Oct 11, 1999
2,728
0
0
Create your perl script so that it just returns the form (blank) when given no parameters. Then when you click submit, the script should detect it, do the action, and redisplay the form with the results in the result textarea.

Assume the script is called: script.pl. You type in http://something/script.pl. The HTML says to send the form to script.pl (itself). When you hit submit, the post data gets sent to script.pl, the data is processed, and the form is sent to the browser with the results.