#!/usr/bin/perl -wT use Net::SSH::Perl; use feature qw( say ); my $ssh = Net::SSH::Perl->new( "1.2.3.4" ); $ssh = Net::SSH::Perl->new( "my.host.name" ); #You can use a hostname $ssh->login( "zaphod", "twoheads2" ); my($stdout, $stderr, $exit) = $ssh->cmd( "cat /dev/universe" ); say "The command said: $stdout"; say "The command error'd: $stderr"; say "The command's exit status was $exit";