in reply to Returning multiple values from subroutine

Another way to handle is this not to change anything in the get_user_info() routine or its interface and use list slice to select which of the paramaters you want. This is a very handy technique in Perl with LOTS of applications. In this application, it allows you get to get rid of all this "undef" business.

Below second statement says give me 1st and 6th things in list. Normally I put the left hand parms in the order that program is going to use them and adjust the slice list according, ie  [5,0], [8,1..3,0], [0,-1] are all valid slices. -1 means last thing in list, -2 would be next to last thing in list. The main limitation is that a range cannot go backwards, 0..3 is ok, but 3..0 is not.

my ($locked,undef,undef,undef,undef,$expire)=$ssh->get_user_info($logi +nid); my ($locked,$expire) = ($ssh->get_user_info($loginid))[0,5];
Upate: a small point, I wouldn't use -1 in slice list here, using the absolute value of 5 allows more parms to be added without affecting existing code. But here is an example where -1 works GREAT!
my ($min,$max) = (sort @something)[0,-1];
Note that works even if there is only one thing in @something! It is ok for the last thing in the list to be the only thing in the list.