Net-SFTP - Re: input must be 8 bytes long at DES.pm line 58.

Posted on Tue Feb 27 18:18:58 2007 by jestill in response to 2747 (See the whole thread of 6)
Re: input must be 8 bytes long at DES.pm line 58.
I was having the same problem when sending a User Password that was taken from the command line. The following code worked for me:
use utf8; # .. MORE CODE HERE .. # GET USER PASSWORD print "\nPassword for $UserName\n"; system('stty', '-echo') == 0 or die "can't turn off echo: $?"; my $UserPassword = <STDIN>; system('stty', 'echo') == 0 or die "can't turn on echo: $?"; chomp $UserPassword; # Remove newline character # Convert to utf8 to avoid problem with DES.pm module utf8::encode ($UserPassword); # THE SFTP CONNECTION THEN WORKS AS $sftp = Net::SFTP->new( $IndTarget, user=> $UserName, password=> $UserPassword, debug=>"true");
Write a response