I am in the process of migrating some production code from Solaris, perl 5.8.0 to RHEL 5.5, perl 5.10. While testing our service we have stumbled upon a corruption when using Net::SSH::Perl and Net::Telnet. Here's my error:

Net-SSH-Perl failed with eval error: Can't locate object method "blocking" via package "FileHandle" at /efs +/dist/perl5/Net-SSH-Perl/1.30/ .exec/x86-64.rhel.5/5.10/lib/perl5/Net/SSH/Perl.pm line 216. at ./ssh_bug_test_final.pl line 49.

Here's my code:

#!/usr/bin/env perl5.10.0 ## your use lib as needed... use strict; use warnings; use Data::Dumper; $Data::Dumper::Sortkeys++; use Net::SSH::Perl; use Net::Telnet; ## fails ## use Net::FTP; ## works my ($server, $href, $conn, ); $server = 'some.test.server.com'; $href = { 'debug' => '1', 'options' => [ 'ChallengeResponseAuthentication no' ], 'protocol' => '2,1', 'use_pty' => '1' }; warn "Running with perl version: %vd\n", $^V; warn 'preparing to call Net::SSH::Perl. ', Dumper( $server, $href ); eval { $conn = Net::SSH::Perl->new( $server, %$href ); }; if ($@) { warn "Net-SSH-Perl failed with eval error: \n$@ "; } else { print 'Net::SSH::Perl succeeds and returns: ', Dumper($conn); }

The confusing thing is that I can use Net::FTP and not Net::Telnet, and my code passes. What is it in Net::Telnet that is corrupting the $sock object in Net::SSH::Perl?

Thanks for your wisdom!


In reply to Corruption between Net::SSH::Perl and Net::Telnet by smile4me

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.