in reply to Populating a hash from array
I was just thinking about hash slices the other day, and wondering: what is the syntax for slicing a hash -reference-? I always end up doing things like
($hashref->{key1}, $hashref->{key2}) = @values;or
{map {$keynames[$_]=>$values[$_]} 0 .. $#values};which seems much less elegant.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Populating a hash from array
by runrig (Abbot) on Jan 05, 2004 at 22:06 UTC | |
by ysth (Canon) on Jan 06, 2004 at 06:56 UTC | |
|
Re^2: Populating a hash from array (rqr)
by tye (Sage) on Jan 06, 2004 at 07:33 UTC |