//File: index.pl
   
#!c:/perl/bin/perl
print "Content-type: text/html\n\n";
print < $inputstring";
@key_value=split(/&/,$inputstring);
foreach $pair ( @key_value){
   ($key, $value) = split(/=/, $pair);
   $value=~s/%(..)/pack("C", hex($1))/ge;
   $value =~ s/\n/ /g;
   $value =~ s/\r//g;
   $value =~ s/\cM//g;
   $input{$key}=$value ; # Creating a hash
}
print "
After decoding:
";
   while(($key, $value)=each(%input)){
   print "$key: $value
";
}
print <