in reply to Simulating Form Posts from within PERL

Compare jeffa's code with the LWP equivalent:
#!/usr/bin/perl -w use HTTP::Request::Common qw(POST); use LWP::UserAgent; my $url = "http://localhost/cgi-bin/display_passed_args.pl"; my $ua = new LWP::UserAgent(); my $request = POST $url, [ test1 => "foo", test2 => "bar" ]; my $response = $ua->request($request); print $response->as_string();
By using LWP, you get to focus on the request/response process at a higher level.