All pastes #468726 Raw Edit

Someone

public text v1 · immutable
·published 2007-05-03 09:47 UTC
rendered paste body
  if ( $ENV{'REQUEST_METHOD'} eq "POST" ) {
    read (STDIN, $query, $ENV{'CONTENT_LENGTH'});
    print "See below for results or search another account.\n";

    # split posted variables into pairs
    my @pairs = split(/&/, $query);
    my $count = 0;
    foreach my $pair (@pairs) {
      my ($name, $value) = split(/=/, $pair);
      $value =~ tr/+/ /;
      $value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack("C", hex($1))/eg;
      $post{$name} = $value;
      $count++;
    }
  }