$server = "x.x.x.x"; my $putty = "C:\\Users\\xxxxxxx\\Downloads\\putty"; my $location = "C:\\Users\\xxxxxxx\\Documents"; open(my $pipe, "$putty\\plink -pw root\@$server /usr/bin/perl /manu/test/test.pl |") or die "unable to run command: $!"; print "Success"; open(my $pipe1, "$putty\\pscp -pw root\@$server:/manu/test/logcollected $location |") or die "unable to run command: $!"; print "\n Again success";