Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Sorting hashes with new value detection

by kutsu (Priest)
on Jan 24, 2006 at 18:00 UTC ( #525269=note: print w/ replies, xml ) Need Help??


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).


Comment on Re: Sorting hashes with new value detection
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://525269]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (3)
As of 2015-07-04 01:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (57 votes), past polls