#!/usr/bin/perl use strict; use warnings; use Net::SSH::Perl; my $user = "zz"; my $password = "ztest"; my $host = 'zentara.zentara.net'; my $cmd = "/usr/bin/wvdial"; my $ssh = Net::SSH::Perl->new( $host, port => 22 ,debug => 1); $ssh->login($user,$password); my($out) = $ssh->cmd($cmd); print "$out\n";