Parts of this confuse me ... for any hashes you only care about the values? Why use a hash in the first place then? There may be a reason in the larger context of your program I'm missing. Why do the individual dereferencing functions use map when they're only ever passed scalars?
I guess my bottom line question is what is it that just prevents you from doing this:
my @a = @$a_ref; # I know it's an array my %h = %$h_ref; # I know it's a hash my @h = values(%$h_ref); # I just want the values # Bascically what you're doing above. my @a = (ref($x) eq 'ARRAY') ? @$x : values(%$x);
In reply to Re: dereferencing hash & array refs
by steves
in thread dereferencing hash & array refs
by parv
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |