Moti <> writes:
> Hi,
> 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 ?
You generally install your script as a CGI script or use mod_perl or
some other more or less server-specific system. CGI is probably the
easiest to learn and certainly the most portable. See the manual page for
the standard CGI module. Type
perldoc CGI
at your command prompt or see
http://perldoc.perl.org/CGI.html
See also:
http://perlmonks.org/?node_id=519640
I wish I could give you a pointer to a really good perl/cgi tutorial but
it's been ages since I looked at one and I can't seem to find any right
now. Most of what you'll find with google is utter crap. At least you
should know a *bit* about how HTTP (the protocol that powers the web)
works, and then the CGI documentation should make more sense.
This seems OK:
http://www.jmarshall.com/easy/http/
Note that you don't need to know all the details of HTTP, but a general
overview is definitely a good thing to have, since then you'll at least
know 1. what the limitations are and 2. how much work CGI.pm is taking
care of for you
> 2) Can I do it on my PC or do I need to upload it to the server ?
You need to put your script at a server that is reachable by your
audience, if you are the only user, you can put it at your own PC,
otherwise, you need to put it somewhere else or make sure your PC is
reachable from the network. In either case, CGI scripts are run from by
a webserver - they're not standalone programs.
> Thanks in advance, Moti.
You're welcome,
Joost.