I have a subroutine that has two parameters: username and password. I would like to setup that subroutine so that it accepts both methods of parameters, meaning foo(user=>$user, pass=>$pass) AND it could also accept foo($user,$pass)... Here is what I have (it accepts user=> and pass=> args:
sub ssh_connect {
my ($self,%args) = @_;
my $user = $args{user};
my $pass = $args{pass};
print "$user and $pass\n";
}