Re: calling perl from html page



Moti wrote:
I'm new to perl and have written a script that I want to run on my web
site. My script gets some text lines and parse them.

I've written a html page that conatins a TEXTAREA and a submit button.
I want to paste some text lines inside the TEXTAREA, Then press the
submit button to call my perl script (with the text in the TEXTAREA as
input) .

My questions are:
1) How can I call my perl script from the html page ?

By making the script URL the action attribute in the form element. Example:

<form action="http://mysite/cgi-bin/myscript.pl"; method="post">
<textarea name="text"></textarea><br>
<input type="submit">
</form>

2) Can I do it on my PC or do I need to upload it to the server ?

You can do it on your PC if you have a web server (and, of course, Perl) installed. Assuming you are on a Windows PC, go to http://www.indigostar.com/indigoperl.htm for the easiest way to get both.

--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
.