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

I had problem with perl exe. I got below error Can't locate object method "port" via package "URI::_foreign" at PERL2EXE_STO RAGE/HTTP/Cookies.pm line 52. Please help on this.Thanks in advance Regards, Sathishkumar S

Replies are listed 'Best First'.
Re: Perl2exe conversion help
by ravi45722 (Pilgrim) on Nov 18, 2015 at 07:31 UTC

    Please post your code what you had tried up to now. Without seeing your code we cant guess where you missed. And update your post to add code tags for your code

      #perl2exe_include "HTTP/Message.pm"; #perl2exe_include "Encode/Locale.pm"; #perl2exe_include "parent.pm"; #perl2exe_include "URI/_foreign.pm"; #perl2exe_include "URI/_generic.pm"; #perl2exe_include "URI/_query.pm"; #perl2exe_include "HTTP/Cookies.pm"; #perl2exe_include "URI.pm"; print "Start \n"; use strict; use URI::_foreign; use URI::_generic; use POSIX; use HTTP::Cookies; use LWP::UserAgent; use HTML::Entities; use WWW::Mechanize; use URI::Escape; use LWP::Simple; use Encode::Byte; use URI; # require URI::_foreign; print "Start 1\n"; my $ua = LWP::UserAgent->new(show_progress=>1); $ua->agent("Mozilla/5.0 (Windows NT 6.1; WOW64; rv:26.0) Gecko/2010010 +1 Firefox/26.0"); $ua->timeout(30); $ua->cookie_jar({}); my $filename ="indiegogo"; my $cookie_file = $filename."_cookie.txt"; unlink($cookie_file); print "Start 2\n"; my $cookie = HTTP::Cookies->new(file=>$cookie_file,autosave=>1); $ua->cookie_jar($cookie); my $url = 'https://www.bing.com/search?q=ALLIANCE+BOOTS+wikipedia&qs=n +&form=QBRE&pq=alliance+boots+wikipedia&sc=1-24&sp=-1&sk=&cvid=745e119 +49da642d586c3e20bead13e60'; my ($req,$res); $req = HTTP::Request->new(GET=>$url); $req->header("Host"=>"www.bing.com"); $req->header("Accept"=>"text/html,application/xhtml+xml,application/xm +l;q=0.9,*/*;q=0.8"); $req->header("Content-Type"=>"application/x-www-form-urlencoded"); $res = $ua->request($req); $cookie->extract_cookies($res); $cookie->save; $cookie->add_cookie_header($req); print "url :: $url"; my $code = $res->code(); print $code,"\n"; if($code =~ m/50/is) { sleep 1000; goto REPEAT; } my $content = $res->content(); open sr,">narva.html"; print sr $content; close sr; exit;