in reply to String format question

If your code is short enough, include it in your post (within <code></code> tags). If it's not short enough, strip out the stuff that doesn't relate to the problem and post the stripped code. We have to be able to see what's going on.

If you have a string that you know works, put code like

if ($string_from_gui ne 'this is the string that works') { die "$string is not the same string!\n"; }
just before you do whatever fails. If it doesn't die there when you test it, you have evil gnomes.

Caution: Contents may have been coded under pressure.

Replies are listed 'Best First'.
Re^2: String format question
by choedebeck (Beadle) on Nov 30, 2005 at 20:32 UTC
    the following code works warning untested
    use Net::SSH::Perl; my $ssh = Net::SSH::Perl->new("myhost", debug => 1, protocol => 2); $ssh->login("myUser", "myPassword"); my ($out, $error) = $ssh->cmd("pwd"); print $out . "\n";
    This code produces the error, "input must be 8 bytes long at /usr/lib/perl5/site_perl/5.8/cygwin/Crypt/DES.pm line 57"
    use Tk; use Net::SSH::Perl; my $username; my $password; my $mw = MainWindow->new(); my $entry1 = $mw->Entry(-textvariable => \$username)->pack(); my $entry2 = $mw->Entry(-textvariable => \$password)->pack(); my $button = $mw->Button( -command => sub { my $ssh = Net::SSH::Perl->new("myhost", debug => 1, protocol => +2); $ssh->login($username, $password); my ($out, $error) = $ssh->cmd("pwd"); print $out . "\n"; } )->pack(); MainLoop;