in reply to Re^3: LWP and IO::Socket often said to me, "Can't locate object method" ....
in thread LWP and IO::Socket often said to me, "Can't locate object method" ....

Hi Paul,

Yes, I don't "use" or "require" IO::Select, but just use IO::Socket.
Perl said to me about "IO::Select".
And, I add the example of LWP:
use strict qw(subs vars); use LWP::UserAgent; use Time::HiRes qw{ time alarm }; use Data::Dumper; ... (snip) ... my $ua = LWP::UserAgent->new() ; ... (snip) ... my $req = HTTP::Request->new( 'GET', $url ) ; $res = $ua->request( $req ) ; ... (snip) ...
My code above resulted in different (mysterious?) error messages....

Can't locate object method "_init" via package "URI::_foreign"

I never use "URI::_foreign" ! It's private class of URI, I think.
I use "IO::Select" and/or "LWP" at fastcgi, daemon modules, so if these error occur, these error last unless fcgi/daemon restarts...
  • Comment on Re^4: LWP and IO::Socket often said to me, "Can't locate object method" ....
  • Download Code

Replies are listed 'Best First'.
Re^5: LWP and IO::Socket often said to me, "Can't locate object method" ....
by Corion (Patriarch) on Oct 14, 2008 at 13:42 UTC
    I use "IO::Select" and/or "LWP" at fastcgi, daemon modules, so if these error occur, these error last unless fcgi/daemon restarts..

    Ah hah. Likely, some other module is requiring IO::Select for you, but not always but only sometimes, depending on the kind of request that comes in. So I can only recommend you actually put use IO::Select; in your code, and also use URI; if you use either of them anywhere.

      Hi Corion,
      Thanks a lot for your recommendation.

      I'll try it, and report you the consequences of this...