3 ms·
I've used perl's array slices as @array[@indices] in the past. Can't remember why, but I have. It also works for hashes: %hash = (foo => "bar", one => "t
by EvilTerran 14y ago
I've used perl's array slices as
@array[@indices]
in the past. Can't remember why, but I have. It also works for hashes:
%hash = (foo => "bar", one => "two", alpha => "beta");
@keys = ('alpha', 'one');
@hash{@keys} == ('beta', 'two');