Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/usr/bin/perl -w use strict; my %hash1 = (); $hash1{key1}{key2}{key3}{A} = "hello"; $hash1{key1}{key2}{key3}{B} = "bye"; my $key = "{key1}{key2}{key3}"; my $new_hash = {}; $new_hash = \%hash1; foreach (keys %{$$new_hash{$key}}) { print "$_ \n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: eval on hash (use \\)
by tye (Sage) on Apr 09, 2003 at 17:28 UTC | |
by Anonymous Monk on Apr 09, 2003 at 17:51 UTC | |
by tye (Sage) on Apr 09, 2003 at 18:06 UTC | |
by dragonchild (Archbishop) on Apr 09, 2003 at 17:53 UTC | |
|
Re: eval on hash
by nothingmuch (Priest) on Apr 09, 2003 at 17:28 UTC | |
by merlyn (Sage) on Apr 09, 2003 at 17:36 UTC | |
|
Re: eval on hash
by tall_man (Parson) on Apr 09, 2003 at 17:31 UTC |