#!/usr/bin/perl BEGIN { eval (" use LWP::UserAgent; use HTTP::Request::Common; "); if ($@) { print "500 Internal Server Error\n"; print "Content-type: text/plain\n"; print "\n"; print $@ die($@); # For the log file. } } print "Content-type: text/html\n\n"; my $ua = LWP::UserAgent->new; my %post = (...); my $response = $ua->request(POST "http://www.example.com/", [ %post ]); print $response->as_string;