in reply to array holding reference of hash and another array
for (@arr) { my @stuff = deref($_); do_stuff_with(@stuff); } sub deref { my $data = shift; if (ref $data eq 'ARRAY') { return @$data; } elsif (ref $data eq 'HASH') { return keys %$data; } else { warn "'$data' is not an array or hash reference!\n"; return; } }
|
|---|