use Net::SSH::Perl; my $ssh; $ssh = new Net::SSH::Perl("192.168.128.4"); $ssh->login("root"); ($x,$y,$z) = $ssh->cmd('pwd');