#!/usr/bin/perl -w use Getopt::Long; use LWP::UserAgent; use HTTP::Cookies; use URI; GetOptions ('t:s' => \$to, 'm:s' => \$smstxt); $smstxt = substr($smstxt, 0, 160); $ua = LWP::UserAgent->new; $ua->cookie_jar({}); my $firsturl = URI->new( 'http://messaging.sprintpcs.com/textmessaging/compose' ); # makes an object representing the URL $firsturl->query_form( # And here the form data pairs: 'phoneNumber' => $to, 'message' => $smstxt, ); my $firstresponse = $ua->get($firsturl); my $secondurl = URI->new( 'http://messaging.sprintpcs.com/textmessaging/composeconfirm' ); $secondurl->query_form( # And here the form data pairs: 'phoneNumber' => $to, 'message' => $smstxt, ); my $secondresponse = $ua->get($secondurl);