in reply to Arrays and Scalar Parameters

I have used two major methods of returning multiple values from a method.

First, if you know that the first n will be your array and the last will be a seperate value then you can use that when picking up your information.

#callMult returning an array and a scalar my @ret = callMult(); my $foo = pop @ret;
However this code can become confusing. I prefer to handle this by returning references for structures.
sub callMult { return \@result, $count; } my ($result, $count) = callMult(); # you can then use $result->[$i]; # to access the array elements # or @result_array = @$result; # to dereference it