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

You failed to use or require. If you feel this is not the case, please supply sources...

-Paul

  • Comment on Re: LWP and IO::Socket often said to me, "Can't locate object method" ....

Replies are listed 'Best First'.
Re^2: LWP and IO::Socket often said to me, "Can't locate object method" ....
by trad-ex (Initiate) on Oct 14, 2008 at 13:04 UTC
    Hi Paul,

    Thanks a lot for your response.
    I'll show you my source, for example:
    #!/usr/bin/perl package hoge::fuga::geho; use strict; use Time::HiRes; use File::Copy; use IO::Socket; ... (snip) ... my $sock = new IO::Socket::INET( PeerAddr => $host, PeerPort => $port, Proto => 'tcp', ); ... (snip)
      This code doesn't mention IO::Select which is the package whose new method seems to be missing. Also, your title seems to mention LWP, but when using that you shouldn't need to ever build a socket directly. This whole thread is so mysterious.

      -Paul

        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...