Don't think it's possible without repeating yourself ... I think it's always "Anti-DRY"!
some ideas:
my ($locked_status,$expire)=$ssh->get_user_info($loginid, qw(locked_status expire) );
$ssh->get_user_info( $loginid, {locked_status=> \$locked_status, expire=> \$expire} );
my ($locked_status,$expire)= @{ $ssh->get_user_info($loginid) }{ qw(locked_status expire) };
my ($locked_status,$expire)= ( $ssh->get_user_info($loginid) )[$idx_locked_status,$idx_expire];
That's untested and I'm not sure if I got the slicing right, but at least the last example is still compatible with your actual practice. But better use constants for the indices..
Cheers Rolf
In reply to Re: Returning multiple values from subroutine
by LanX
in thread Returning multiple values from subroutine
by walkingthecow
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |