my @values = f(...); # simple read,
# @values is a copy
####
my %hash = f(...); # hash is also a copy
my $value = $hash{'value'};
##
##
my (@v1, @v2) = f(...);
##
##
sub f {
(...)
return \@v1, \@v2, \%v3; # return 2 array and a hash
# reference
}
my ($ar1, $ar2, $hr3) = f(); # collect references
my @ar1 = @{ $ar1 }; # get the first array,
# creating a duplicate
foreach (@ {$ar2} ) {...} # avoid copying the array,
# probably more efficient
my $value = $hr3->{'value'} # some people find this
# notation cumbersome
# and avoid references