hi everyone. im not sure how to explain my situation because im not a native english speaker so please bear with my grammar. awhile ago my boss asked me to make a perl script to simulate a user signup on a beta website for testing purposes. i came from a hardware background with zero knowledge of perl so im really in high emotions when he asked me to do such. anyway, i started reading perl noobs howtos up to mid-advanced , then perldocs until i came up with a crippled code.
what im trying to do is this: automate a single signup process on a remote https website, grab whatever messages returned, and store the output on a file or stdout. the website i am being asked to make a perl script is http://www.i.ph/signup.php
#!/usr/bin/perl -w
use LWP::UserAgent;
$ua = LWP::UserAgent->new;
$ua->agent("Mozilla 8.0");
use HTTP::Request::Common qw(POST);
my $req = (POST 'https://www.i.ph/signup.php',
[ "username" => "nonsense",
"usermail" => 'myemail@yahoo.com',
"userpassword1" => "password",
"userpassword2" => "password",
"usermobile" => "639165263265",
"userchallenge" => "test test",
"useranswer" => "test",
"agreement" => 1
]);
$request = $ua->request($req);
$content = $request->content;
print $content;
exit;
"agreement" here is a checkbox. i tried google-izing this, searched through perdocs and cpan but either i found nothing relevant or i just didnt know where to look. obviously what i did on the code above is wrong.
surely there is another (way better) way to do this, im not even sure this code nearly accomplishes what im trying to do. atleast i hope i have stated my objective/goal clearly. please enlighten me.
note:i believe i have all the necessary modules installed (SSLcrypt, SSLeay, etc.) since i can GET the https page.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.