#!/usr/bin/perl use Net::SSH::Perl; use strict; my $cmd = 'w'; my $host = 'devel.dot.com'; my $user = 'john'; my $ssh = Net::SSH::Perl->new ($host, compression=>1); $ssh->login($user, 'pass'); my ($out, $err, $exit) = $ssh->cmd($cmd); print $out;