#!/usr/bin/perl # Parseform Sub-Routine. # Usage: drop sub into CGI script. When you need to parse the form, # do a &parseform; . The data is stored in the %FORM hash. To access, # use the form $FORM{'field_name'} . # From http://www.cgi.tj/ sub parseform { if ($ENV{'REQUEST_METHOD'} eq 'GET') {@pairs = split(/&/, $ENV{'QUERY_STRING'});} elsif ($ENV{'REQUEST_METHOD'} eq 'POST') { read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'}); @pairs = split(/&/, $buffer); } else { print "Content-Type: text/html\n\n"; print "