use IO::Socket; $host="localhost"; $path="/cgi-bin/display_passed_args.pl"; $str="test1=foo&test2=bar"; $sock = IO::Socket::INET->new("$host:80"); $sock->autoflush(); print $sock "POST $path HTTP/1.0\n"; print $sock "Host: $host\n"; print $sock "Content-type: application/x-www-form-urlencoded\n"; print $sock "Content-length: ".length($str)."\n"; print $sock "Connection: close\n\n"; print $sock $str;