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";