Skip to content

Instantly share code, notes, and snippets.

@megawertz
Created November 14, 2017 17:57
Show Gist options
  • Save megawertz/c7c4d6d1b777ba5884ed1e009b7c1c25 to your computer and use it in GitHub Desktop.
Save megawertz/c7c4d6d1b777ba5884ed1e009b7c1c25 to your computer and use it in GitHub Desktop.
Echo form submitted data back to web browser for in-class demonstration purposes.
#!/usr/bin/perl
use URI::Query;
use Data::Dumper;
print "Content-Type: text/html\n\n";
print "You sent the server:\n\n";
print "<br><hr><br><pre>";
print $ENV{'QUERY_STRING'};
print "</pre>";
print "<br><hr><br><pre>";
my $q = URI::Query->new( $ENV{'QUERY_STRING'} );
my %hash = $q->hash;
print Dumper( \%hash );
print "</pre>";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment