you can't declare a hash slice via myYou could have done
but I don't know of any other one-statement way. Does Perl 6 provide a convenient syntax to declare a hash and initialize a slice of it in one swell foop?@$_{ @intersection } = @hash1{ @intersection } for \my %intersection;
In reply to Re^4: Intersect two hashes (initialize hash slice)
by ysth
in thread Intersect two hashes
by HarshaHegde
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |