in reply to How do you test for return type($,@,%)?
A subroutine can return only single value. That value could be scalar or reference of variable. If we want to return scalar(single) variable then we can do like..
return $a;
If want to return array list or hash list then we need to return reference of array or hash Consecutively like..
return \@name_of_array_variable;
return \%name_of_hash_variable;
Hope this will resolve the issue.
Originally posted as a Categorized Answer.
|
|---|