in reply to Did I have to roll my own?

You can use LWP::UserAgent
use LWP::UserAgent; my $ua = LWP::UserAgent->new; my $req = HTTP::Request->new(POST => 'http://www.foobar.com/cgi-bin/fo +obar'); $req->content_type('application/x-www-form-urlencoded'); $req->content('foobar=5'); my $res = $ua->request($req); print $res->as_string;
You can get more information by looking in lwpcook.(pod|html) that came with libwww-perl.

Replies are listed 'Best First'.
Re: Re: Did I have to roll my own?
by merlyn (Sage) on Jan 19, 2001 at 02:23 UTC
    Even simpler would be to follow the advice in lwpcook:
    Lazy people use the HTTP::Request::Common module to set up a suitable POST request message (it handles all the escap- ing issues) and has a suitable default for the con- tent_type: use HTTP::Request::Common qw(POST); use LWP::UserAgent; $ua = LWP::UserAgent->new; my $req = POST 'http://www.perl.com/cgi-bin/BugGlimpse', [ search => 'www', errors => 0 ]; print $ua->request($req)->as_string; The lwp-request program (alias POST) that is distributed with the library can also be used for posting data.

    -- Randal L. Schwartz, Perl hacker