in reply to Multiple keys for a hash table row?

Just make new hash keys that reference the original keys' values:

use strict; use warnings; my %foo = ( "GENERATE" => "10 14 00 07 4d", "DELIVER" => "16 75 32 14 77" ); $foo{CREATE} = \$foo{GENERATE}; $foo{DELIV} = \$foo{DELIVER}; use Data::Dumper; print Dumper \%foo;

However, now you need to de-reference the values to use them:

print ${ $foo{CREATE} }, $/;

I recommend just duplicating the data:

$foo{CREATE} = $foo{GENERATE}; $foo{DELIV} = $foo{DELIVER};
Unless you know you will be dealing with million and millions of hash keys. Clarity is very important. Also, check the CPAN for modules that allow you to alias hash keys.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

Replies are listed 'Best First'.
Re^2: Multiple keys for a hash table row?
by mike65535 (Novice) on Dec 10, 2015 at 20:41 UTC
    I'll have very few hash keys (a dozen or so).

    Likely I'll have way more aliases.

    Thanks.

    Mike