dragonchild has asked for the wisdom of the Perl Monks concerning the following question:
Now, what this does is assign undef to $hash{4} and $hash{5}. Is there a nice way I can do something like:my @keys = (1 .. 5); my @values = (6 .. 8); my %hash; @hash{@keys} = @values;
That doesn't work, but that's what I'm trying to do ...@hash{@keys} = @values || '';
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash slices and too many keys
by merlyn (Sage) on Jul 28, 2001 at 03:31 UTC | |
|
Re: Hash slices and too many keys (Update cause I can't edit a root node)
by dragonchild (Archbishop) on Jul 27, 2001 at 23:55 UTC | |
by lestrrat (Deacon) on Jul 28, 2001 at 00:07 UTC | |
|
Re: Hash slices and too many keys
by PrakashK (Pilgrim) on Jul 28, 2001 at 02:57 UTC | |
|
Re: Hash slices and too many keys
by mongooser (Initiate) on Jul 28, 2001 at 03:26 UTC | |
|
Re: Hash slices and too many keys
by premchai21 (Curate) on Jul 29, 2001 at 07:37 UTC |