Re: perl script

by "Ryan Fischer" <ryan(at)gigabee.com>

 Date:  Wed, 19 Dec 2001 18:12:50 -0500
 To:  <FODAC(at)aol.com>,
<hwg-techniques(at)mail.hwg.org>
 References:  aol
  todo: View Thread, Original
You wrote:
> I'm trying to run the following test form and corresponding perl
> script. Everything shows but the variable "name". Can anyone see
> why this is?
>
> Kevin Riggs
>
> <HTML>
>
> <HEAD>
>
> <TITLE>Test form</TITLE>
>
> </HEAD>
>
> <BODY>
>
> <FORM METHOD="post" ACTION="cgi-bin/form.pl">
>
> Name:<INPUT TYPE="text" NAME="name">
>
> <br>
>
> <INPUT TYPE="submit" VALUE="click here">
> </FORM>
>
> </BODY>
>
> </HTML>
>
>
> and the perl script:
>
> #!/usr/bin/perl
>
>
> use CGI;
>
> my $handler;
> $handler = CGI::new();
>
> print $handler->header();
> print $handler->start_html(
>   -title=>"form results\n",
>   -bgcolor=>"#ffff00");
> print "Name: $name";

This should be:

print "Name: " $handler->param('name');

If you want to parse all variables in to simple ones, something like
this should work:

for(qw/name/){
    ${$_} = $handler->param($_);
}

HTH!  :)

--
 -Ryan :: ICQ - 595003 :: GigaBoard - http://www.gigaboard.net/

HWG hwg-techniques mailing list archives, maintained by Webmasters @ IWA