Hi again, I took your advice and managed to get together a script for my request. here is what I have so far sorry, i don't really know how to configure this post..so it's kind of messy
#!/usr/bin/perl -w use LWP::UserAgent; my $digits; open( FILE, "< /tmp/blah.txt" ) or die "Can't open $filename : $!"; while( <FILE> ) { $digits = $_; print "Attempting line: " . $digits; k_go_now($digits); # Sleep to keep us slightly more hidden and load off their servers sleep(1); } # k go now sub; grabs input from file ($username, $password) tries to +login sub k_go_now { my ($digits) = @_; $ua = LWP::UserAgent->new; $ua->agent("MyApp/0.1 "); # Create a request my $req = HTTP::Request->new(POST => 'https://xxx'); $req->content_type('application/x-www-form-urlencoded'); $req->content('query=libwww-perl&mode=dist'); # Pass request to the user agent and get a response back my $res = $ua->request($req); # Check the outcome of the response if ($res->is_success) { check_output ($res->content); } else { print $res->status_line, "\n"; } } # suib check_output checks the response from the website and if it's a +ny good sub check_output { my ($output) = @_; if ($output =~ /Login Failed/) { print "Nope, failed login\n"; } elsif ($output =~ /Login Successful/) { print "got'em with login details\n"; } else { print "unknown response !!!\n$output\n\n"; } }
I'm pretty sure it's all good but I cant help but think that I screwed up somewhere with the syntax, could you guys point me in the right direction please? When I run it, it says Line 7 is a possible typo. Thanks -sjlo

In reply to Where did I go wrong? by sjlo

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.