Is there a simple way to declare a hash with multiple keys which all point to the same value in perl?
Here is something similar to what I’m looking for (I don’t actually know if this works or not):
my $hash = {
a, b, c => $valA,
d, e, f => $valB
};
such that….
print $hash->{a}; #prints $valA
print $hash->{b}; #prints $valA
print $hash->{c}; #prints $valA
print $hash->{d}; #prints $valB
print $hash->{e}; #prints $valB
print $hash->{f}; #prints $valB
You can write this: