in reply to Returning multiple values from subroutine
I'd suggest returning a hash ref with the values. That way, you can get only the ones you want via a hash slice, like so:
...roboticus#!/usr/bin/perl use strict; use warnings; my ($locked_status, $expire) = @{get_user_info()}{'locked_status', 'ex +pire'}; print "lock=$locked_status, exp=$expire.\n"; sub get_user_info { return { locked_status=>5, expire=>4, other_junk=>3 } }
|
|---|