dw_perlmonks has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl use strict; use warnings; use 5.010; use Data::Dumper; $Data::Dumper::Sortkeys = 1; $Data::Dumper::Terse = 1; $Data::Dumper::Quotekeys = 0; my @a1 = ( 'a1', 1, 1, 1 ); my @a2 = ( 'a2', 2, 2, 2 ); my $a1_ref = \@a1; my $a2_ref = \@a2; my @a = ( $a1_ref, $a2_ref ); my %h = (); for my $i ( 1 .. 2 ) { $h{"$i"} = \@a; } say Dumper \%h;
{ '1' => [ [ 'a1', 1, 1, 1 ], [ 'a2', 2, 2, 2 ] ], '2' => $VAR1->{'1'} }
Any help appreciated. thanks in advance!{ '1' => [ [ 'a1', 1, 1, 1 ], [ 'a2', 2, 2, 2 ] ], '2' => [ [ 'a1', 1, 1, 1 ], [ 'a2', 2, 2, 2 ] ] }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: help with references
by moritz (Cardinal) on May 04, 2013 at 19:18 UTC | |
by dw_perlmonks (Novice) on May 04, 2013 at 19:42 UTC | |
by moritz (Cardinal) on May 04, 2013 at 20:11 UTC | |
|
Re: help with references
by tobyink (Canon) on May 04, 2013 at 19:22 UTC | |
by dw_perlmonks (Novice) on May 04, 2013 at 20:09 UTC | |
|
Re: help with references
by poj (Abbot) on May 04, 2013 at 19:49 UTC | |
|
Re: help with references
by 2teez (Vicar) on May 04, 2013 at 23:31 UTC | |
|
Re: help with references
by locked_user sundialsvc4 (Abbot) on May 06, 2013 at 13:30 UTC | |
|
Re: help with references
by dw_perlmonks (Novice) on May 09, 2013 at 22:53 UTC |