in reply to Submitting a form w/ UserAgent

Here's some code I pulled out of perldoc lwpcook and modified to use the POST request to grab this very question:
use HTTP::Request::Common qw( POST ); use LWP::UserAgent; my $ua = new LWP::UserAgent; my $req = POST 'http://perlmonks.org/index.pl', [node_id => '20494']; print $ua->request($req)->as_string;
HTTP::Request::Common handles quoting and encoding for you. If you like your way better, you'll need the following:
$req->content_type('application/x-www-form-urlencoded'); $req->content('node_id=20494');
before you call $ua->request() on it.