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

Hello, I'm new so if this is already answered somewhere, please direct me to it - I've searched on google, yahoo, aspn and here for this. I am using Net::SSH::W32Perl to open up SSH sessions from a Windows box to various servers. Everytime I do so, I get a bunch of messages from IO::Socket::INET and IO::String. Here's an example:

IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 118 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295 IO::String at C:/Perl/site/lib/Net/SSH/Perl/Channel.pm line 110 IO::Socket::INET at C:/Perl/site/lib/Net/SSH/Perl/SSH2.pm line 295

How do I stop these messages? Thanks

Replies are listed 'Best First'.
Re: IO::Socket::INET Messages
by ikegami (Patriarch) on Aug 09, 2006 at 20:39 UTC
    I don't know, but the messages are from Net::SSH::Perl::SSH2 and Net::SSH::Perl::Channel, not from IO::Socket::INET and IO::String.
Re: IO::Socket::INET Messages
by Anonymous Monk on Aug 09, 2006 at 21:18 UTC
    How do I stop these messages?

    If they don't indicate an actual problem with your code you could try turning warnings off. If that doesn't work maybe eval the suspect lines, if you're sure that $host is valid:

    die "Need a host" unless $host; eval { $ssh = Net::SSH::Perl->new($host, protocol => 2) }; die "Something broke: $@" if $@; # if it matters
    Look inside the modules to see what's happening:

  • Net/SSH/Perl/SSH2.pm
  • Net/SSH/Perl/Channel.pm
Re: IO::Socket::INET Messages
by zjzzhang (Initiate) on Jun 08, 2009 at 03:20 UTC

    I'm also getting this type message when i use SSH2 on windows XP. There's a little info how to get rid of this message.

    Here's solution refer to the following link:

    http://diswww.mit.edu/bloom-picayune.mit.edu/perl/28965

    In the above way, the modification of carp will affect my total projects. So i try to find another way that:

    Just comment out the call of carp in _trapped function in IO::Select::Trap module.

    sub _trapped {

    my ($self, $h) = @_;

    if ((ref $h) =~ /$self->{traps}/i) {

    #carp (ref $h)." is trapped.";

    return 1;

    } else {

    #carp (ref $h)." is NOT trapped.";

    return 0;

    }

    }