- or download this
%hash = (
foo => 'bar',
...
);
(ref() eq 'CODE') && $_ = \$hash{ $_->() } for values %hash;
- or download this
%hash = (
foo => 'bar',
...
);
(ref() eq 'ARRAY') && $_ = \$hash{ $_->[0] } for values %hash;
- or download this
%hash = (
foo => 'bar',
...
);
/^REF:(.+)/ and $_ = \$hash{$1} for values %hash;
- or download this
%hash = ();
for (
...
) {
$hash{ $_->[0] } = $_->[1];
}
- or download this
%hash = ();
%temp = (
...
);
$hash{$_} = $temp{$_} for keys %temp;