- or download this
#!/usr/bin/perl -w
use strict;
...
my %by_value = reverse %hash;
print Dumper(\%by_value);
- or download this
$VAR1 = {
'1' => 'a',
'2' => 'e'
};
- or download this
my %hash = (
a => 1,
b => 1,
...
}
print Dumper(\%by_value);
- or download this
$VAR1 = {
'1' => [
'a',
...
'd'
]
};