When executing alwayson.exe then I get the following error:
Name=JohnSmith, pass=test content= filter= *********MATCH()******* Can't locate object method "host" via package "URI::_foreign" at URI/W +ithBase.pm line 48.
I make the executable and run it using the following commands:
call perlapp -v -r -s=alwayson.pl -f -a=URI::_foreign;lwp::protocol::h +ttp;http::request::common;lwp::useragent;http::cookies;uri::file;uri: +:_server alwayson.exe "JohnSmith" "test"
perlapp spews out the following output without errors:
Input script name: alwayson.pl Output exe name: alwayson.exe Exe Mode: Freestanding Building Console mode exe Temp files will be kept on exit Failed 'use's will be reported Additional module: URI::_foreign Additional module: lwp::protocol::http Additional module: http::request::common Additional module: lwp::useragent Additional module: http::cookies Additional module: uri::file Additional module: uri::_server Adding Module: C:/Perl/site/lib/HTTP/Response.pm Adding Module: C:/Perl/lib/Exporter.pm Adding Module: C:/Perl/lib/Carp.pm Adding Module: C:/Perl/lib/IO/Socket.pm Adding Module: C:/Perl/site/lib/HTTP/Message.pm Adding Module: C:/Perl/site/lib/URI.pm Adding Module: C:/Perl/site/lib/URI/_generic.pm Adding Module: C:/Perl/site/lib/HTML/HeadParser.pm Adding Module: C:/Perl/lib/Errno.pm Adding Module: C:/Perl/site/lib/http/cookies.pm Adding Module: C:/Perl/lib/Time/Local.pm Adding Module: C:/Perl/lib/DynaLoader.pm Adding Module: C:/Perl/lib/auto/DynaLoader/dl_expandspec.al Adding Module: C:/Perl/lib/auto/DynaLoader/dl_findfile.al Adding Module: C:/Perl/lib/auto/DynaLoader/dl_find_symbol_anywhere.al Adding Module: C:/Perl/lib/auto/DynaLoader/autosplit.ix Adding Module: C:/Perl/lib/IO/Socket/UNIX.pm Adding Module: C:/Perl/lib/SelectSaver.pm Adding Module: C:/Perl/site/lib/uri/file.pm Adding Module: C:/Perl/lib/IO.pm Adding Module: C:/Perl/site/lib/LWP/UserAgent.pm Adding Module: C:/Perl/site/lib/uri/_server.pm Adding Module: C:/Perl/site/lib/HTML/Parser.pm Adding Module: C:/Perl/lib/IO/Socket/INET.pm Adding Module: C:/Perl/lib/strict.pm Adding Module: C:/Perl/lib/vars.pm Adding Module: C:/Perl/lib/Config.pm Adding Module: C:/Perl/site/lib/HTTP/Request/Common.pm Adding Module: C:/Perl/lib/Socket.pm Adding Module: C:/Perl/site/lib/http/request/common.pm Adding Module: C:/Perl/site/lib/HTTP/Date.pm Adding Module: C:/Perl/site/lib/HTML/Entities.pm Adding Module: C:/Perl/site/lib/URI/URL.pm Adding Module: C:/Perl/site/lib/HTTP/Headers.pm Adding Module: C:/Perl/site/lib/URI/_foreign.pm Adding Module: C:/Perl/site/lib/LWP/Debug.pm Adding Module: C:/Perl/site/lib/URI/Escape.pm Adding Module: C:/Perl/site/lib/LWP.pm Adding Module: C:/Perl/site/lib/lwp/protocol/http.pm Adding Module: C:/Perl/lib/XSLoader.pm Adding Module: C:/Perl/lib/IO/Select.pm Adding Module: C:/Perl/site/lib/HTTP/Headers/Util.pm Adding Module: C:/Perl/site/lib/HTTP/Request.pm Adding Module: C:/Perl/site/lib/LWP/MemberMixin.pm Adding Module: C:/Perl/lib/Dynaloader.pm Adding Module: C:/Perl/lib/auto/Dynaloader/dl_expandspec.al Adding Module: C:/Perl/lib/auto/Dynaloader/dl_findfile.al Adding Module: C:/Perl/lib/auto/Dynaloader/dl_find_symbol_anywhere.al Adding Module: C:/Perl/lib/auto/Dynaloader/autosplit.ix Adding Module: C:/Perl/site/lib/HTTP/Status.pm Adding Module: C:/Perl/lib/Symbol.pm Adding Module: C:/Perl/lib/Exporter/Heavy.pm Adding Module: C:/Perl/site/lib/URI/_query.pm Adding Module: C:/Perl/site/lib/lwp/useragent.pm Adding Module: C:/Perl/site/lib/URI/WithBase.pm Adding Module: C:/Perl/lib/warnings/register.pm Adding Module: C:/Perl/lib/warnings.pm Adding Module: C:/Perl/lib/IO/Handle.pm Adding Module: C:/Perl/lib/overload.pm Adding Module: C:/Perl/site/lib/LWP/Protocol.pm Adding Module: C:/Perl/lib/AutoLoader.pm Adding Module: C:/Perl/site/lib/HTTP/Cookies.pm Adding Binary: C:/Perl/lib/auto/Socket/Socket.dll Adding Binary: C:/Perl/lib/auto/IO/IO.dll Done creating alwayson.exe
The perl script itself outputs the following if run without using perlapp:
*********MATCH()******* *********MATCH(/cgi-bin/pu_index.fcgi?newbranch=d24&action=framestart) +******* *********MATCH(/cgi-bin/pu_help2.fcgi?page=frameset_nn_shl&id=1-d24-OA +RIycshBQMvBYHVeoEIemBw)******* *********MATCH(/cgi-bin/pu_login0.fcgi?id=1-d24-OARIycshBQMvBYHVeoEIem +Bw)******* *********MATCH(/cgi-bin/pu_login1.fcgi?password=adidafs&id=1-d24-OARIy +cshBQMvBYHVeoEIemBw&nickname=Sime)******* LOGGED ON! Sleeping...
alwayson.pl looks like this:
use LWP::UserAgent; use HTTP::Request::Common; use HTTP::Cookies; my $user_name = $ARGV[0]; my $user_pass = $ARGV[1]; print "Name=$user_name, pass=$user_pass\n"; do { `if exist alwayson.log del alwayson.log`; open(LOG, ">alwayson.log"); $ua = LWP::UserAgent->new; $ua->cookie_jar(HTTP::Cookies->new(file => "alwayson.cookies", aut +osave => 1)); my ($response, $url) = clickon("", ''); ($response, $url) = clickon($response->content, 'content="\d+;url= +([^"]+)'); ($response, $url) = clickon($response->content, 'location.href="([ +^"]+)"'); ($response, $url) = clickon($response->content, 'frame name="login +" src="([^"]+)"'); $response->content =~ /name="id" value="([^"]+)"/m; my $id_tag = $1; my $url = "http://www.friendscout.de/cgi-bin/pu_help2.fcgi?id=$id_ +tag&page=loginp&nickname=$user_name&password=$user_pass"; $response = $ua->request(GET $url); printf LOG qq(\n\nurl: $url\n\n%s\n\n), $response->content; ($response, $url) = clickon($response->content, 'parent.main.locat +ion.replace\("([^"]+)"'); my $url = "http://www.friendscout.de/cgi-bin/pu_help.fcgi?page=nav +2&id=$id_tag"; # <-- where does nav2 comes from? $response = $ua->request(GET $url); printf LOG qq(\n\nurl: $url\n\n%s\n\n), $response->content; print "LOGGED ON!\n"; print "Sleeping...\n"; close(LOG); sleep 5; undef $ua; } while ( 1 ); sub clickon { my $content = shift @_; my $filter = shift @_; print "content=$content\nfilter=$filter\n"; if ($content =~ /$filter/m) { print "*********MATCH($1)*******\n"; my $url = "http://www.friendscout.de$1"; my $response = $ua->request(GET $url); if($response->is_success) { print "success!\n"; } else { printf "failure! %s\n", $response->message; } printf LOG qq(\n\nurl: $url\n\n%s\n\n), $response->content; return ($response, $url); } else { die "redirect not found !"; } }
Any ideas?

In reply to Problem getting PerlApp to work by BinBerliner

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.