if ($ARGV[2] eq "Linux") { my $file = "C:\\Bounce\\$ARGV[0].txt"; open(INFO, ">$file"); print INFO "$ARGV[0]\n"; print INFO "$ARGV[3]\n"; print INFO "$ARGV[1]\n"; #Script executes fine upto this line. #From this line onwards it is not excuted and jumps to sleep (5) and exits; my $host = "$ARGV[0].domain.com"; my $user = "username"; my $pass = "password"; my $cmd = "cd $ARGV[3] && ./startServer.sh $ARGV[1]"; my $ssh = Net::SSH::W32Perl->new( $host, protocol => 2 ); $ssh->login($user, $pass); my($stdout, $stderr, $exit) = $ssh->cmd($cmd); #print $stdout, "\n"; print INFO $stdout; close(INFO); sleep (5); }