#!/usr/bin/perl use bignum; #============================================================================= # Get POSTed parameters. # Read stadard input (POST) to pick up the parameters (key-value pairs). # Should be on a single line, but loop over lines, just in case. my %param; while (<>) { # Tokenize, splitting on "&". my @kv = split("&", $_); # key = value # Put into a hash (a "map" in Java-speak), for easy access. foreach my $pair (@kv) { $pair =~ /(.*)=(.*)/; $param{$1} = $2; } } #============================================================================= # HTTP Response #----------------------------------------------------------------------------- # Header print "Content-Type: text/html\n"; print "\n"; #============================================================================= # Payload #----------------------------------------------------------------------------- # HTML start print << "START";