Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
I am asked to create a 3 by 7 matrix in perl with a specified key for each row.I have heard about hashes with keys.Is matrix is also having key?? For eg: Monday dishes 1 Tuesday vacuum 2 Wednesday garbage 3
Here outbut is garbage alone.What if i need to get both garbage and 3 if i give the key Wednesday?Is it possible in hash? </code>%chores = ("Monday", "dishes","1", "Tuesday", "vacuum","2", "Wednesday +", "garbage","3"); $value = $chores{Wednesday}; print "$value";
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Keyed matrix
by Marshall (Canon) on Sep 03, 2012 at 12:09 UTC | |
|
Re: Keyed matrix
by choroba (Cardinal) on Sep 03, 2012 at 12:17 UTC | |
|
Re: Keyed matrix
by daxim (Curate) on Sep 03, 2012 at 12:12 UTC | |
|
Re: Keyed matrix
by aitap (Curate) on Sep 03, 2012 at 12:21 UTC | |
|
Re: Keyed matrix
by protist (Monk) on Sep 03, 2012 at 12:32 UTC | |
|
Re: Keyed matrix
by BillKSmith (Monsignor) on Sep 03, 2012 at 12:21 UTC |