[Ssh-sftp-perl-users] input must be 8 bytes long at Crypt/DES.pm line 57
Brought to you by:
dbrobins
From: Glen F. <gfo...@ho...> - 2006-12-27 16:41:58
|
Hi I'm a newbie to perl and I was trying to write a script to read a xml with all the info for the connection and all the commands that need to run on the remote machine. I was using Net::SSH::Perl and it works if I don't get the variables from the xml, but if I read the xml using XML::Simple or XML:Smart it give the the following error: input must be 8 bytes long at /usr/lib/perl5/site_perl/5.8.8/i586-linux-thread-multi/Crypt/DES.pm line 57. If I put in the info to login to the ssh server hardcoded in the script it works but when ever I use the variables that were read by the XML modules it give me the error. If I hardcode the login info to the script and then try to use commands that were read from the xml script it give me the same error. Can someone help me please!!! Thanks in advance, Glen I'm running: opensuse 10.1. Net This is perl, v5.8.8 built for i586-linux-thread-multi Net-SSH-Perl-1.30 Crypt-DES-2.05 XML-Simple-2.16 XML-Smart-1.6.9 cpan script version 1.03 CPAN.pm version 1.7602 The script is: #!/usr/bin/perl -w use XML::Smart; use Net::SSH::Perl; my $XML = XML::Smart->new($ARGV[0]); my $host = $XML->{Server}->{ip}; my $user = $XML->{Server}->{user}; my $password = $XML->{Server}->{password}; my $ssh = Net::SSH::Perl->new ($host); $ssh->login($user, $password); print "Connected...\n"; The XML -------------------------------- <Server> <ip>10.10.10.10</ip> <user>userName</user> <password>password</password> <Commands> <Command>cd d:/</Command> </Commands> </Server> _________________________________________________________________ >From photos to predictions, The MSN Entertainment Guide to Golden Globes has it all. http://tv.msn.com/tv/globes2007/ |