Note that your code can be simplified to
or the non-destructivemy %y; $y{shift(@x)} = 1 while @x;
my %y = map { $_ => 1 } @x;
In reply to Re^3: use array for hash-keys without loop
by ikegami
in thread use array for hash-keys without loop
by piccard
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |