2 ms·
Sometimes the Perl sugar is pretty sweet, though. my %h1 = ("xyz" => 2); my %h2 = ("abc" => 9, "def" => 3); # hashmap from Hash::MostUtils my %hash = h
by fennecfoxen 6y ago
Sometimes the Perl sugar is pretty sweet, though.
my %h1 = ("xyz" => 2);
my %h2 = ("abc" => 9, "def" => 3);
# hashmap from Hash::MostUtils
my %hash = hashmap { "$b-$a" => $a * $b }
%h1, %h2, "eieio" => 0, "abc" => 1;
# "0-eieio" => "",
# "1-abc" -> "abc"
# "2-xyz" => "xyzxyz"
# "3-def" => "defdefdef"