in reply to Strange Net::SSH::Perl and Tk Checkbutton Interaction!?! SOLVED

Pretty weird. Maybe %ARGS is being internally used by Net::SSH::Perl? And it is confusing everything? Does %ARGS3 (or any other variant work?)

I'm not really a human, but I play one on earth. Cogito ergo sum a bum
  • Comment on Re: Strange Net::SSH::Perl and Tk Checkbutton Interaction!?!

Replies are listed 'Best First'.
Re^2: Strange Net::SSH::Perl and Tk Checkbutton Interaction!?!
by cmv (Chaplain) on Nov 09, 2007 at 14:22 UTC
    zentara-

    Good thought! I was hoping that was it, but alas, it even fails when using $qqq:

    #!/usr/bin/perl use English; use strict; use Data::Dumper; use Tk; my $qqq = '-l'; my $www = '-l'; # Setup remote ssh connection... my $host='rhost'; use Net::SSH::Perl; #use Net::SSH::W32Perl; # For windows #my $ssh = Net::SSH::W32Perl->new($host) # For windows my $ssh = Net::SSH::Perl->new($host) || die "Bad $host"; $ssh->login('rusr', 'rpass') || die "Bad login"; # Create new window... my $top = MainWindow->new(-title=>'Options Test'); $top->minsize(470,225); my $f = $top->Frame()->pack; my $t = $top->Scrolled('Text')->pack; # Add checkbuttion in frame... $f->Checkbutton(-text=>$qqq, -offvalue=>'', -onvalue=>$qqq, -variable=>\$qqq, -command=>\&hostls, )->pack(-side=>'left'); # Reset checkbutton variable (default is off)... $qqq=''; sub hostls { print STDERR Dumper(\$qqq); print STDERR "qqq=$qqq\n"; $t->delete('1.0', 'end'); my($stdout, $stderr, $exit) = $ssh->cmd("ls $qqq"); # Fails #my($stdout, $stderr, $exit) = $ssh->cmd("ls $www"); # Works if($exit) { warn "Bad Command return\n$stderr"; return() }; $t->insert('end', $stdout); } MainLoop();
    This seems to be a really tough bug. Please help!

    Thanks

    -Craig