my $s = Net::Appliance::Session->new({ personality => "FreeBSD411", add_library => "./PhaseBooks", transport => 'SSH', host => $host, #privileged_paging => 1, # only if using ASA/PIX OS 7+ # and there are other behaviour options, see below connect_options => { opts => [ '-p', '22', # connect to non-standard port on remote host #'-o', 'CheckHostIP=no', # don't check host IP in known_hosts file ], }, log_config => { dispatchers => ['screen','file'], screen => { class => 'Log::Dispatch::Screen', min_level => 'warning', }, file => { class => 'Log::Dispatch::File', min_level => 'debug', filename => '/var/log/myapp.log', mode => 'append', format => '[%d] %m', }, }, }); $s->set_global_log_at('debug'); try { my @result = shift; my @cmds = ('whoami','uname -a','df -h'); $s->connect({ username => $user, password => $pass, privileged_password => $su_pass}); $s->disable_paging(1); $s->begin_privileged({$su_pass}); ## I don't know how to call this ;) or Doesn't work ? push @result, $s->cmd("$cmds[0]"); #push @result, $s->cmd("$cmds[1]"); #push @result, $s->cmd("$cmds[2]"); $s->end_privileged; print "Host: $host \"@cmds\": @result \n"; } catch { warn "failed to execute command: $_"; } finally { $s->close; };