#!/usr/bin/perl use strict; use warnings; use Net::SSH::Perl; use Net::SSH::Perl::Constants qw(MAX_PACKET_SIZE); my $host = 'host'; my $user = 'user'; my $pass = 'pass'; my $cmd = 'perldocs Net::SSH::Perl::Constants'; my $ssh = Net::SSH::Perl->new( $host, debug => 1, protocol => 2 ); $ssh->login($user, $pass); my($stdout, $stderr, $exit) = $ssh->cmd($cmd); print $stdout, "\n";