Re: [Ssh-sftp-perl-users] Net::SSH::Perl problem
Brought to you by:
dbrobins
From: Matthew J. S. <vag...@ya...> - 2006-04-21 13:13:24
|
--- Joel Lansden <Jo...@di...> wrote: > Greetings all, > > I am trying to use Net::SSH::Perl to execute remote > commands on a server > via SSH. Unfortunately, it appears that any > commands that require > arguments will crash the module. > For example, if I do "ls" it works fine.. But if I > send "ls -l" it will > give me this: > > -------------------------------------------------------- > input must be 8 bytes long at > /usr/lib/perl5/site_perl/5.8.0/i386-linux-thread-multi/Crypt/DES.pm > line > 57. > -------------------------------------------------------- > > Does anyone have a fix for this? > > Thanks!!! > ~Joel There are 2 things that I would recomend trying. One of the solutions will solve your problem (99% sure). 1. my($out, $err, $exit) = $ssh->cmd($cmd, [ $stdin ]) ex. my($out, $err, $exit) = $ssh->cmd("ls", "-l") 2. use Encode; use Encode; ... Encode::from_to($cmd,'utf8','iso-8859-1'); my($out, $err, $exit) = $ssh->cmd("ls", "-l") ... Good luck __________________________________________________ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com |