Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/local/bin/perl use strict; use warnings; my (@tempd, %tempa); push @tempd, (nm=>'abc', sz=>'def'); $tempa{'a'}{'zeta'}=[@tempd]; print "array: ", join " ", @tempd, "\n"; my $tmp = $tempa{'a'}{'zeta'}; print "hash: ", $tempa{'a'}{'zeta'}, "\n"; print "hash: ", $$tmp[0], " ", $$tmp[1], "\n"; Result: array: nm abc sz def hash: ARRAY(0x40039370) hash: nm abc
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: double hash, array, and hashed data structure
by mr_mischief (Monsignor) on Mar 12, 2008 at 22:38 UTC | |
|
Re: double hash, array, and hashed data structure
by almut (Canon) on Mar 12, 2008 at 22:49 UTC | |
by ack (Deacon) on Mar 13, 2008 at 04:43 UTC | |
|
Re: double hash, array, and hashed data structure
by NetWallah (Canon) on Mar 12, 2008 at 23:32 UTC | |
by Anonymous Monk on Mar 13, 2008 at 05:25 UTC | |
|
Re: double hash, array, and hashed data structure
by repellent (Priest) on Mar 13, 2008 at 19:23 UTC |