in reply to Re: Declare and slice-initialize hash in one statement?
in thread Declare and slice-initialize hash in one statement?
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.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: Declare and slice-initialize hash in one statement?
by BrowserUk (Patriarch) on Oct 27, 2005 at 17:06 UTC | |
by Roy Johnson (Monsignor) on Oct 27, 2005 at 17:25 UTC | |
by BrowserUk (Patriarch) on Oct 27, 2005 at 17:36 UTC | |
by Roy Johnson (Monsignor) on Oct 27, 2005 at 17:46 UTC | |
by BrowserUk (Patriarch) on Oct 27, 2005 at 17:59 UTC | |
|