while iam trying with simple code like this
use Net::SSH::W32Perl; my $ssh = Net::SSH::W32Perl->new($host,use_pty => 0,); $ssh->login($user, $pass); my $Command="ls -lrt"; my($stdout, $stderr, $exit) = $ssh->cmd($Command); print "$stdout";
yes it is wroking fine,giving the out put also
but iam using in TK ,as function it is giving errors
sub ConnectSSH { print LOG " [FunctionName][ConnectSSH] \n"; my $ClearCaseSSHObject = Net::SSH::W32Perl->new($host,use_pty => +0,debug=>1); if($ClearCaseSSHObject) { if(!$ClearCaseSSHObject->login('$user','$password') ) { print LOG " Unable to connect SSH \n"; &ErrorNotification(ERR_LOGIN_TITLE,ERR_LOGIN_MSG); $MainScreenObject -> Unbusy( -recurse => '1' ) +; return(0); } else { print LOG "connected Sucesfully"; } } else { print LOG " Unable to connect network \n"; &ErrorNotification("ERR_CON_TITLE","ERR_CON_MSG"); } #For retrieving SSHobject decalring globally $ClearCaseSSHObjectRef = $ClearCaseSSHObject; return($ClearCaseSSHObjectRef); }

indamaaaf31786: Reading configuration data /.ssh/config indamaaaf31786: Reading configuration data /etc/ssh_config indamaaaf31786: Connecting to host, port 22. indamaaaf31786: Socket created, turning on blocking... indamaaaf31786: Remote protocol version 2.0, remote software version OpenSSH_3.7.1p2-pwexp26 "makerandom" is not exported by the Crypt::Random module at E:/perl/site/lib/Crypt/Random/Generator.pm line 12 "makerandom_itv" is not exported by the Crypt::Random module at E:/perl/site/lib/Crypt/Random/Generator.pm line 12 "makerandom_octet" is not exported by the Crypt::Random module at E:/prl/site/lib/Crypt/Random/Generator.pm line 12 Tk::Error: Can't continue after import errors at E:/perl/site/lib/Crypt/Random/Generator.pm line 12 BEGIN failed--compi +lation aborted at E:/perl/site/lib/Crypt/Random/Generator.pm line 12, <GEN2> line 1. Compilation failed in require at E:/perl/site/lib/Crypt/Random.pm line 18, <GEN2> line 1. BEGIN failed- +-compilation aborted at E:/perl/site/lib/Crypt/Random.pm line 18, <GEN2> line 1. Compilation f +ailed in require at E:/perl/site/lib/Crypt/DH.pm line 6, <GEN2> line 1. BEGIN failed--comp +ilation aborted at E:/perl/site/lib/Crypt/DH.pm line 6, <GEN2> line 1. Compilation failed + in require at E:/perl/site/lib/Net/SSH/Perl/Kex/DH1.pm line 13, <GEN2> line 1. BEGIN failed--compilation aborted at E:/perl/site/lib/Net/SSH/Perl/Kex/DH1.pm line 13, <GEN2> line 1. Compilation failed in require at E:/perl/site/lib/Net/SSH/Perl/Kex.pm line 6, <GEN2> line 1. BEGIN failed--compilation aborted at E:/perl/site/lib/Net/SSH/Perl/Kex.pm line 6, <GEN2> line 1. Compilation failed in require at E:/perl/site/lib/Net/SSH/Perl/SSH2.pm line 6, <GEN2> line 1. BEGIN failed--compilation aborted at E:/perl/site/lib/Net/SSH/Perl/SSH2.pm line 6, <GEN2> line 1. Compilation failed in require at E:/perl/site/lib/Net/SSH/W32Perl/SSH2.pm line 7, <GEN2> line 1. BEGIN failed--compilation aborted at E:/perl/site/lib/Net/SSH/W32Perl/SSH2.pm line 7, <GEN2> line 1. Compilation failed in require at E:/perl/site/lib/Net/SSH/Perl.pm line 55, <GEN2> line 1. Crypt::Random +::BEGIN at E:/perl/site/lib/Crypt/Random.pm line 18 Crypt::DH::BEGIN at E:/perl/site/lib/Crypt/DH.pm line 6 Net::SSH::Perl::Kex::DH1::BEGIN at E:/perl/site/lib/Net/SSH/Perl/Kex/DH1.pm line 13 Net::SSH::Perl::Kex:: +BEGIN at E:/perl/site/lib/Net/SSH/Perl/Kex.pm line 6 Net::SSH::Perl::SSH2::BEGI +N at E:/perl/site/lib/Net/SSH/Perl/SSH2.pm line 6

Edited by planetscape - added code tags around program output

( keep:1 edit:10 reap:0 )

2006-07-11 Retitled by planetscape, as per Monastery guidelines

( keep:3 edit:9 reap:0 )

Original title: 'SSH not wroking with TK'


In reply to SSH not working with TK by veeruch

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.