Thanks for your infomation. I will try to use Net::SSH2.
Main Topics
Browse All TopicsI believe Net::SSH::W32Perl is a very useful Perl module. After installing this module with kind help in here. I still have some problems.
1. my($stdout, $stderr, $exit) = $ssh->cmd("exit > /dev/null 2> /dev/null");
when execute this command, sometime it works, sometime doesn't work.
2. my($stdout, $stderr, $exit) = $ssh->cmd($cmd);
print "$stdout\n";
They didn't work. How can I get result after execute a command?
Thanks very much in advance.
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Business Accounts
Answer for Membership
by: FishMongerPosted on 2009-09-22 at 06:06:11ID: 25392315
Net::SSH::W32Perl was last updated in 2002 and appears to be no longer maintained. It would be better to use Net::SSH::Perl or Net::SSH2
Which ever module you end up using, you'll need to add proper error handling.
For example:
my $ssh = Net::SSH::Perl->new($host) or die "can't ssh to '$host' $!";
You should also add the following 2 pragmas (to every Perl script).
use strict;
use warnings;
Why are you executing an 'exit' command in the ssh call?
Exactly what are you trying to accomplish with that call?