in reply to Sorting hashes with new value detection
Code from my pad (in order to be more permenant):
my %hash = ( 1 => ["apple"], 2 => ["melon", "grape"], 3 => ["pear", "orange"] ); print "Level $_\n@{$hash{$_}}\n\n" for keys %hash; #or possibly my @array = (["apple"], ["melon", "grape"], ["pear", "orange"]); print "Level ", ++$_, "\n@{$array[$_]}\n\n" for 0 .. $#array;
Note, it merely prints the "level structure", twice :), sulfericacid asked for in his orginal question (on the CB).
In Section
Seekers of Perl Wisdom