Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

Problem getting PerlApp to work

by BinBerliner (Novice)
on May 30, 2001 at 15:38 UTC ( [id://84224]=perlquestion: print w/replies, xml ) Need Help??

BinBerliner has asked for the wisdom of the Perl Monks concerning the following question:

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?

Replies are listed 'Best First'.
Re: Problem getting PerlApp to work
by BinBerliner (Novice) on May 30, 2001 at 16:45 UTC
    After a lot of trial and error fiddling then the following PerlApp line gets it to work:
    perlapp -v -r -s=alwayson.pl -f -a=AutoLoader;Config;DynaLoader;Errno; +IO;LWP;SelectSaver;Socket;Symbol;URI;XSLoader;Exporter::Heavy;IO::Han +dle;IO::Select;IO::Socket;IO::Socket::INET;IO::Socket::UNIX;LWP::Prot +ocol::HTTP;URI::_FOREIGN;URI::_GENERIC;URI::_QUERY;URI::_SERVER;URI:: +URL;URI::HTTP
    But how to arrive at this list of modules *without* the nasty trial and error part? Anybody know?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://84224]
Approved by root
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others perusing the Monastery: (4)
As of 2024-03-28 08:40 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found