#!/usr/bin/perl -w use strict; run_server(); sub debug_post_data() { warn "DEBUG: the content length is $ENV{CONTENT_LENGTH}\n"; my $returncode = read(STDIN, my $post_content, $ENV{CONTENT_LENGTH}); warn "DEBUG: the read returncode was $returncode\n"; warn "DEBUG: Finished.\n"; } sub run_server() { $| = 1; print "Content-Encoding: iso-8859-1\015\012", "Content-Type: text/plain\015\012", "\015\012"; debug_post_data(); }