1234567891011
sub foo(\%hash_ref);sub foo(\@array_ref);sub foo { if (ref($_[0]) eq "HASH") { my %hash = %{ $_[0] }; } elsif (ref($_[0]) eq "ARRAY") { my @array = @{ $_[0] }; } }