Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
why wont this work, i just get these lines:#!/usr/bin/perl use URI::URL; use LWP::UserAgent; use HTTP::Request; use HTTP::Request::Common; use HTTP::Request::Form; use HTML::TreeBuilder 3.0; my $ua = LWP::UserAgent->new; my $url = url 'http://www.smsdevice.com/users/sms.php?id=3'; my $res = $ua->request(GET $url); my $tree = HTML::TreeBuilder->new; $tree->parse($res->content); $tree->eof(); my @forms = $tree->find_by_tag_name('FORM'); die "What, no forms in $url?" unless @forms; my $f = HTTP::Request::Form->new($forms[0], $url); $f->field("nr", "+46703123456"); $f->field("msg", "hello world"); my $response = $ua->request($f->press("submit")); print $response->content if $response->is_success;
Edit Petruchio Sun Nov 18 04:31:53 UTC 2001 - Added markup.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: im trying to get my perl script to post a CGI query
by hopes (Friar) on Nov 18, 2001 at 08:41 UTC |