Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: Keyed matrix

by protist (Monk)
on Sep 03, 2012 at 12:32 UTC ( #991419=note: print w/replies, xml ) Need Help??


in reply to Keyed matrix

You could do this using anonymous references...but you will have to dereference to get at the lists

#!/usr/bin/perl use warnings; use strict; #create a hash where each key is matched with an anonymous array refer +ence my %chores = ( Monday => ["dishes","1"], Tuesday => ["vacuum","2"], Wednesday => ["garbage","3"]); #get the reference to the list stored in the key Wednesday my $valuereference = $chores{Wednesday}; #make value the list that valuereference is referring to my @value = @{$valuereference}; #print each element of the list @value, followed by a newline print $_."\n" for @value;

I hope that helps :)

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://991419]
help
Chatterbox?
[erix]: yes, I got it :) It's close to where I live (Utrecht)
[LanX]: Dutch royals usually spent their exiles on Berlin
[erix]: well, dutch royals are germans, really
[choroba]: Utrecht? Is that where we made the trip, LanX?
[erix]: we should really dupm the lot, but I got no say in the matter :)
[LanX]: yeah its a religious mafia , the only two big calvinist houses are dutch and prussian. ..
[LanX]: choroba yes
[erix]: Utrecht has a beautiful old center, and less mass-tourism than Amsterdam
[erix]: next time, drop by :)
[LanX]: religion is also the reason how the house of Hanover aquire the English throne, all other candidates on succession where catholics...

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (12)
As of 2017-12-15 16:36 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What programming language do you hate the most?




















    Results (439 votes). Check out past polls.

    Notices?