#!c:\Perl\bin\perl use warnings; package DataHandler; $webmaster = 'admin@zixsys.com'; use constant USERNAME_TEST_PASS => 42; sub parse_form_data { print "Content-type: text/plain", "\n\n"; local (*FORM_DATA) = @_; local ( $request_method, $query_string, @key_value_pairs, $key_value, $key, $value ); print "Run Test", "\n"; $request_method = $ENV{'REQUEST_METHOD'}; print "The data sent to FORM_DATA is:", @_, "\n"; if ( $request_method eq "GET" ) { $query_string = $ENV{'QUERY_STRING'}; print "GET query_string is:", $query_string, "\n"; } elsif ( $request_method eq "POST" ) { read( STDIN, $query_string, $ENV{'CONTENT_LENGTH'} ); print "POST query_string is: ", $query_string, " and the length is: $ENV{'CONTENT_LENGTH'}\n"; }