#!d:/perl -w use strict; use Net::SSH::W32Perl; my ($ipaddr,$userid,$passwd) = ("","",""); my $cmd = "dir"; my $ssh = Net::SSH::W32Perl->new("$ipaddr", protocol => '2,1',debug => 1); my ($out, $err, $exit,$msg); $ssh->login("$userid","$passwd"); ($out, $err, $exit) = $ssh->cmd("$cmd"); print $out. $err. $exit."\n"; close $ssh;