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"; #### 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;