in reply to cgi_handlers.pl

I'm not sure how cgi_handlers.pl worked, but I would see how variables are created from the HTML form. Most old CGI scripts I've run into set up some type of hash with the field name as the key and the user-supplied value as the value.

With CGI.pm, you can port your old CGI script and create a hash with the HTML form variables with a simple loop:

use CGI; $query = new CGI; foreach ($query->param()) { $fields{$_} = $query->param($_); } # now you can access the HTML form field 'name' like so: print "Hello, " . $fields{'name'} . "!\n"; # or you can use the CGI.pm methodology (which would mean # you'd have to port all of the instances of your HTML form # variables: print "Hello, " . $query->param('name') . "!\n";

HTH,

Jason

Replies are listed 'Best First'.
Re: Re: cgi_handlers.pl
by Amoe (Friar) on Nov 06, 2001 at 00:10 UTC
    As a side note: to get the params in a hash with CGI you can also do the handy thing:
    use CGI ':cgi-lib'; my %params = Vars;
    Neat.

    --
    my one true love