mike65535 has asked for the wisdom of the Perl Monks concerning the following question:
Can I make something like this:my %foo_commands = { "GENERATE" => "10 14 00 07 4d", "DELIVER" => "16 75 32 14 77" ... };
I know that literally I cannot (I tried it!), but is there a workable construct? It should be clear I do not want to duplicate the rows, making one per spelling (that's the whole point).my %foo_commands = { "GENERATE", "CREATE" => "10 14 00 07 4d", "DELIVER", "DELIV" => "16 75 32 14 77" ... };
In the end I'd like to have several alternative "keys" per row, including some subset of abbreviations.
(Note: The code that "looks up" the row in the hash table uses a command line argument so I want to give the user the most flexibility)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multiple keys for a hash table row?
by SuicideJunkie (Vicar) on Dec 10, 2015 at 19:53 UTC | |
|
Re: Multiple keys for a hash table row?
by jeffa (Bishop) on Dec 10, 2015 at 19:49 UTC | |
by mike65535 (Novice) on Dec 10, 2015 at 20:41 UTC | |
|
Re: Multiple keys for a hash table row?
by Discipulus (Canon) on Dec 10, 2015 at 21:44 UTC | |
|
Re: Multiple keys for a hash table row?
by GotToBTru (Prior) on Dec 10, 2015 at 21:33 UTC | |
|
Re: Multiple keys for a hash table row?
by AnomalousMonk (Archbishop) on Dec 11, 2015 at 04:21 UTC | |
|
Re: Multiple keys for a hash table row?
by GrandFather (Saint) on Dec 10, 2015 at 22:12 UTC |