- or download this
use strict;
use warnings;
...
my @keys = @{$HoA{$key2}};
say "Keys @keys have the same value: $key2 ";
}
- or download this
$ perl reverse_hash.pl
Keys a have the same value: 1
Keys c f have the same value: 3
Keys b d have the same value: 2
Keys e have the same value: 5
- or download this
0 HASH(0x60025cbb8)
1 => ARRAY(0x60006f210)
...
1 'f'
5 => ARRAY(0x600495808)
0 'e'