in reply to Problem to connect remote host
login("xxxx","xxxx");
If your $ssh object was undefined, you would get the error
Can't call method "login" on an undefined value
Net::SSH: Bad host name: at foo.pl line 3
Furthermore, it's a good idea to ping the machine first, and then attempt to ssh into it.
Last but not least don't double-quote single variables as in the useless interpolation
Net::SSH::Perl->new ("$hostname");
Say rather
Net::SSH::Perl->new ($hostname);
--shmem
_($_=" "x(1<<5)."?\n".q·/)Oo. G°\ /
/\_¯/(q /
---------------------------- \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}
|
---|