in reply to Complex hash?
I don't recommend this, but just so you can see how you can do it:
I'll leave handling the HASH case as your excercise. ;)for (sort keys %hash) { print "$_ => "; if (ref($hash{$_}) eq 'ARRAY') { print join(', ', @{ $hash{$_} }); } elsif (ref($hash{$_}) eq 'HASH') { # do something else } else { print $hash{$_}; } print "\n"; }
jeffa
L-LL-L--L-LL-L--L-LL-L-- -R--R-RR-R--R-RR-R--R-RR B--B--B--B--B--B--B--B-- H---H---H---H---H---H--- (the triplet paradiddle with high-hat)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Complex hash?
by GrandFather (Saint) on Aug 24, 2006 at 20:48 UTC |