in reply to Perl LWP and POST

Maybe try something like this instead:

#!/usr/bin/perl -w use strict; use LWP::UserAgent; my $browser = LWP::UserAgent->new; my @req = ('http://www.wheresmycellphone.com/submit.php', [txtisdcode => 1, txtcitycode => '000', txtphone => '00000 +00']); my $response_to_discard = $browser->post(@req); print $response_to_discard->as_string();

In particular, that line

my $resp = (POST 'www . wheresmycellphone . com/', ['txtisdcode' => 1, + txtcitycode' => '000', 'txtphone' => '0000000']);

is wrong in several respects:

(I wonder how you got that past -w and use strict;...)

Replies are listed 'Best First'.
Re^2: Perl LWP and POST
by ProgramIT (Novice) on May 31, 2009 at 14:59 UTC
    Thanks! This works alot better. After looking at the HTML for the page it is what I expect. However, I still don't receive the phone call. It is as though the data I am trying to submit isn't actually being submitted. Any idea why this is?

      Have you tried adding submitcall => "Make it Ring!", as atcroft suggested?

      If that doesn't work either, I'd submit the form from a browser, while logging the headers that are being exchanged — using Firefox's LiveHTTP Headers add-on, or some such, in order to see if there's something else (session cookie?) that you need to mimic...

        atcroft's suggestion worked. Thanks so much to both of you for helping me better understand how to POST data to a form.