Re: Perl site - Elementary question



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.

.



Relevant Pages

  • IBM Informix Web DataBlade: Local root by design
    ... IBM Informix Web DataBlade: Local root by design ... Impact: Any user who can: 1) Save a Perl script anywhere on the server's ... admin right on any database can do it by loading the WDB module into ...
    (Bugtraq)
  • Re: free unreferenced scalar error
    ... >> The test script is as trim as it gets. ... If the database is other than SQL Server the ... This is perl, v5.8.4 built for MSWin32-x86-multi-thread ... Step 2: Copy script file ...
    (perl.dbi.users)
  • Re: Server-side script executed on page load or event, but not SSI
    ... I'm sorry I used the term 'database'. ... I know I can do it simply by linking to the script, ... for running a perl script automagically when a page is loaded. ... Are there any other perl alternatives? ...
    (comp.lang.perl.misc)
  • DBD::Oracle 1.46 cant find library
    ... years (a perl cgi script that interrogates Oracle databases), ... When I try to invoke oracletool now (either 2.2 or the saved version ... Senior Database Administrator ...
    (perl.dbi.users)
  • What am I doing wrong?
    ... Being new to PERL, I've found this very informative list and I've been playing ... calculates the total stock for identical items. ... I've created a small database ... However my main problem is that the script does ...
    (perl.beginners)