Re: [Ssh-sftp-perl-users] SSH2 Connecting Issue
Brought to you by:
dbrobins
From: Enrique de A. S. <enr...@pc...> - 2006-03-15 13:55:26
|
You can try this code: my $ssh2 = Net::SSH2->new(); eval { $ssh2->connect($host) }; die "Cannot connect to host.\n" if ($@); print "Connected"; # etc, etc, etc... Regards, Enrique. Hardik Vyas wrote: > I am having issues with the SSH2 connect method. When the $WEB_SERVER > is valid, it works fine and connects but when the $WEB_SERVER is invalid > that perl script hangs at the connect method and "Can not connect" is > never printed (Note: $WEB_SERVER is a parameter that is passed via the > command line). Has anyone had similar problems and know how I can fix > this issue? > > my $conn = Net::SSH2->new(); > > if($conn->connect("$WEB_SERVER")) > > { > > print "Connected"; > > } > > else > > { > > print "Can not connect"; > > } > > > > > ------------------------------------------------------- This SF.Net > email is sponsored by xPML, a groundbreaking scripting language that > extends applications into web and mobile media. Attend the live webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642 > _______________________________________________ Ssh-sftp-perl-users > mailing list Ssh...@li... > https://lists.sourceforge.net/lists/listinfo/ssh-sftp-perl-users |