rose has asked for the wisdom of the Perl Monks concerning the following question:
Hi Monks,
Can you please guide me how to push an array into Hash of Array.
#!/usr/local/bin/perl use strict; use Data::Dumper; my @arr; my %hash; my @arr=['rose','orange','green']; $hash{"first"}=[@arr]; print STDERR Dumper(\%hash);
I want to push the following @newarr into %hash in same key
my @newarr=['red','blue'];
Need %hash value for the following
UPDATE:: Sorry, I need Hash key conains two array
$hash = { 'first' => [ 'rose', 'orange', 'green' ], [ 'blue', 'red' ] };
Please guide me
Thanks
Rose
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: push an array into Hash of Array
by wfsp (Abbot) on Sep 16, 2008 at 14:57 UTC | |
by wrinkles (Pilgrim) on Sep 17, 2008 at 07:43 UTC | |
by wfsp (Abbot) on Sep 17, 2008 at 08:03 UTC | |
by alittlebitdifferent (Initiate) on Oct 26, 2011 at 03:18 UTC | |
by choroba (Cardinal) on Oct 26, 2011 at 07:18 UTC | |
|
Re: push an array into Hash of Array
by kyle (Abbot) on Sep 16, 2008 at 14:28 UTC | |
|
Re: push an array into Hash of Array
by pjotrik (Friar) on Sep 16, 2008 at 14:29 UTC |