Hi, I have a script that I have been running successfully on perl 5.6.1. It uses Net::SSH to send the code of another perl script to a remote host. I tried to move the script(s) to a new box running 5.8 and it errors out while trying to run the cmd method on the command string passed to it. Here is the error (that is very misleading) and the relevant parts of the script. For some reason if I try to feed a `cat` to the $cmd string, it does not work
use Net::SSH::Perl; $host = "somehost"; my $ssh = Net::SSH::Perl->new($host, protocol => '2', debug => 1, privileged => 0); # THIS FAILS, WORKED FINE BEFORE #my $cmd = "perl -e '".`cat ./cm-unix.pl`."'"; # THIS IS JUST A ONE LINE FILE with 'ls-l' THAT FAILS my $cmd = `cat GO`; # WORKS FINE my $cmd = 'cd /tmp; ls -l'; $ssh->login( $ENV{USER} ); my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
ERROR: input must be 8 bytes long at /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Crypt/DES.pm line 57.
---
I have tried google and searching throug the archives but not have been able to find out why this happens Thanks for any help, Jim

In reply to Net:SSH:Perl Bug? by neptuna

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.