On 10 Sep 2012 13:44:20 -0000
Peter Scott <[email protected]> wrote:
> On Mon, 10 Sep 2012 20:52:41 +0800, andrew sison wrote:
> > I don't get how you can actually print the contents of the subhash.
>
> Generic hash-of-hashes iteration example:
>
> for my $outer_key ( keys %hash )
> {
> print "Outer key: $outer_key:\n";
> for my $inner_key ( sort keys %{ $hash{$outer_key} } )
> {
> print "\t$inner_key: $hash{$outer_key}{$inner_key}\n";
> }
> }
>
You can also use Data::Dumper.
use Data::Dumper;
print Dumper \%hash;
See `perldoc Data::Dumper` for details.
Data::Dumper is a standard module that is included in all Perl
installations. For a complete list of standard modules and pragmatics,
see `perldoc perlmodlib`.
--
Just my 0.00000002 million dollars worth,
Shawn
Programming is as much about organization and communication
as it is about coding.
_Perl links_
official site : http://www.perl.org/
beginners' help : http://learn.perl.org/faq/beginners.html
advance help : http://perlmonks.org/
documentation : http://perldoc.perl.org/
news : http://perlsphere.net/
repository : http://www.cpan.org/
blog : http://blogs.perl.org/
regional groups : http://www.pm.org/
--
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
http://learn.perl.org/