in reply to Re: How to save first two columns of an array into another array
in thread How to save first two columns of an array into another array
Ok and how do I read the same (i.e. those first two columns into a hash).
this is what I tried.
But the output is wrongmy %h; my @a = map { [@{ $_ }[0]] } @S; my @b = map { [@{ $_ }[1]] } @S; @h{@a} = @b; print Dumper(@a); print Dumper(@b); print Dumper(%h); print "or\n"; print Dumper(\%h);
$VAR1 = { 'ARRAY(0x8411210)' => [ 'e' ], 'ARRAY(0x840d768)' => [ 'c' ], 'ARRAY(0x83f3308)' => [ 'c' ] };
|
---|
Replies are listed 'Best First'. | |
---|---|
Re^3: How to save first two columns of an array into another array
by Athanasius (Archbishop) on Oct 02, 2012 at 14:25 UTC | |
by zing (Beadle) on Oct 02, 2012 at 15:19 UTC | |
by Athanasius (Archbishop) on Oct 03, 2012 at 03:38 UTC | |
Re^3: How to save first two columns of an array into another array
by Anonymous Monk on Oct 02, 2012 at 14:27 UTC |
In Section
Seekers of Perl Wisdom