Hi
i want to write a subroutine for SSH Connection then call the sub in another line , now how put arguments in the sub
sub SSHApp { #SSH Connection to Applaince my $ssh_1 = Net::Appliance::Session->new({personality => 'ios', tr +ansport => 'SSH', host => "$MyIP",}) ; $ssh_1->connect({ username => "$MyUser", password => "$MyPass" + }) ; $ssh_1->begin_privileged({ password => 'ai'}) ; print $ssh_1->cmd('sh version') ; $ssh_1->end_privileged ; $ssh_1->close; } my $result = SSHApp(); print "$result" , "\n" ;
In reply to subroutine For ssh by GHMON
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |