Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: hash of hashes

by NetWallah (Abbot)
on Oct 06, 2013 at 05:13 UTC ( #1057115=note: print w/ replies, xml ) Need Help??


in reply to hash of hashes

This is probably what you are looking for:

use strict; my %byColor; while (<DATA>){ my ($fruit, @colors) = split; for my $c(@colors){ push @{ $byColor{$c} }, $fruit; } } for my $c(sort keys %byColor){ print "$c\t @{$byColor{$c}}\n"; } __DATA__ strawberry red green rose apple red rose mango green
Output:
green strawberry mango red strawberry apple rose strawberry apple

             My goal ... to kill off the slow brain cells that are holding me back from synergizing my knowledge of vertically integrated mobile platforms in local cloud-based content management system datafication.


Comment on Re: hash of hashes
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (6)
As of 2014-10-31 05:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (214 votes), past polls