Re: Perl site - Elementary question
- From: usenet@xxxxxxxxxxxxxxx
- Date: 30 Oct 2005 00:47:21 -0700
kejoseph@xxxxxxxxxxx wrote:
> I want to setup a "quick and dirty" site which grabs information from
> users (in a form having 8-10 fields) and dumps it to a database.
>
If you mean a "real" database like MySQL (as opposed to appending info
to a textfile, sometimes loosely called a "database") then you have a
whole new area of programming to be 'overwhelmed' with.
> I want to use Apache and Perl to achieve the same.
Good choice.
> What is the difference between mod_perl 2.0 , lwp module and cgi module?
You won't use lwp for your project. You don't need to understand how
mod_perl works - just "use strict" and it should run fine with or
without mod_perl (the only thing mod_perl does for you - at least at
your level - is improve performance. You WILL use the CGI module.
> 2. I have setup Apache 2.0 with mod_perl 2.0. I have also created the
> form which contains the information the user will send.
What you have probably created is a pure HTML form. The usual "Perl"
approach would be to have a script that generates the form "on the fly"
and that same script also processes the form. So you never write HTML.
Instead of:
<a href="www.google.com">Google</a>
you write:
a({href => 'www.google.com}, "Google")
This is all done using the CGI.pm module, which will become your best
friend.
> How do I gather or receive the form information ... in perl
That's where you use the CGI.pm module. Since you've (probably) written
your form already in pure HTML, you have the form's "target" call a
Perl CGI script, which processes the parameters and does whatever you
want.
As others have pointed out, there is TONS of info on the web about
this. Also, Lincoln Stein, the author of the CGI.pm module, wrote a
book about it, which you can get on Amazon (http://tinyurl.com/e3lpz)
or many other places. It has step-by-step illustrated examples of
EXACTLY what you are trying to do.
.
- Follow-Ups:
- Re: Perl site - Elementary question
- From: Brian Wakem
- Re: Perl site - Elementary question
- From: Juha Laiho
- Re: Perl site - Elementary question
- From: Gunnar Hjalmarsson
- Re: Perl site - Elementary question
- Prev by Date: Re: Performance & Perl
- Next by Date: Re: Can (nearly) any Perl program be written on a single line?
- Previous by thread: Re: Perl site - Elementary question
- Next by thread: Re: Perl site - Elementary question
- Index(es):
Relevant Pages
|