Which is also available in List::MoreUtils, with no referencing needed.
use strict; use List::MoreUtils qw(zip); my @keys = (1..3); my @values = (4..6); my %hash = zip @keys, @values;
-xdg
Code written by xdg and posted on PerlMonks is public domain. It is provided as is with no warranties, express or implied, of any kind. Posted code may not have been tested. Use of posted code is at your own risk.
In reply to Re^2: Declare and slice-initialize hash in one statement?
by xdg
in thread Declare and slice-initialize hash in one statement?
by chester
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |