#!/usr/bin/perl -w use strict; use Net::SSH::Perl; my $cmd = "ping -c 3 perlmonks.org"; my $ssh = Net::SSH::Perl->new("192.168.1.1"); $ssh->login("user", "pass"); my($a, $b, $c) = $ssh->cmd($cmd); print "$a\n$b\n$c\n";