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; } }
In reply to Re: array holding reference of hash and another array
by dsheroh
in thread array holding reference of hash and another array
by Sun751
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |