Skip to content

Instantly share code, notes, and snippets.

@ozuma
Last active December 17, 2015 03:48
Show Gist options
  • Save ozuma/5545734 to your computer and use it in GitHub Desktop.
Save ozuma/5545734 to your computer and use it in GitHub Desktop.
Perl CGI: Dump POST(HTTP) body to a temporary file.
#!/usr/bin/perl
use strict;
my $postdata;
read(STDIN, $postdata, $ENV{'CONTENT_LENGTH'});
my $time = time();
open(FP, ">/var/tmp/post-${time}.dat");
print FP $postdata;
close(FP);
print "Content-type: text/plain\n\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment