Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/user/bin/perl -w use warnings; use strict; my %hash = ( "00:00:00" => "a", "00:20:00" => "a", "10:00:00" => "b", "20:00:00" => "a", "02:22:00" => "b", ); my %hash2 = ( "00:00:00" => "a", "00:20:00" => "a", "10:00:00" => "b", "20:00:00" => "a", "02:22:00" => "b", ); my @bla = (%hash, %hash2);
foreach (keys $hash){ print $_ . "\n"; }
foreach (keys $bla[0]){ print $_ . "\n"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Using foreach to iterate through a hash in an array
by choroba (Cardinal) on Aug 30, 2017 at 11:28 UTC | |
by Anonymous Monk on Aug 30, 2017 at 11:36 UTC | |
by AnomalousMonk (Archbishop) on Aug 30, 2017 at 15:08 UTC | |
|
Re: Using foreach to iterate through a hash in an array
by AnomalousMonk (Archbishop) on Aug 30, 2017 at 15:27 UTC | |
|
Re: Using foreach to iterate through a hash in an array
by thanos1983 (Parson) on Aug 30, 2017 at 15:41 UTC |