in reply to push an array into Hash of Array
#!/usr/local/bin/perl use strict; use warnings; use Data::Dumper; $Data::Dumper::Indent = 1; my @array1 = qw{rose orange green}; my @array2 = qw{blue red}; my %hash; push @{$hash{q{first}}}, \@array1, \@array2; print Dumper \%hash;
update: clarified$VAR1 = { 'first' => [ [ 'rose', 'orange', 'green' ], [ 'blue', 'red' ] ] };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: push an array into Hash of Array
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 |