system("ssh root\@\remoteIP /usr/bin/ls");
The double quotes interpolate so that \r is going to become a carriage return. That's one source of problems.
Some other tips:
my $cmd = "ssh $user\@$host /usr/bin/ls"; warn "Executing '$cmd'"; system ($cmd);
🦛
In reply to Re: Calling a remote ssh connection from perl
by hippo
in thread Calling a remote ssh connection from perl
by KenHorse
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |