opensourcer has asked for the wisdom of the Perl Monks concerning the following question:
I'm unable to print values of hash who is inside of another hash. I'm trying to print values of version and type.
can any 1 help me with this .$data = { data => 'hello', complicated => { version => 1, type => 'struct', }, req => 'Submit' }; foreach (keys %$data ) { if (ref($data->{$_})) { foreach (keys %{$data->{$_}}) { print " $_ : ".$data->{$_}->{$_}."\n"; } } }
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: printing refence of hash inside a hash
by Samy_rio (Vicar) on May 12, 2007 at 06:39 UTC | |
Re: printing refence of hash inside a hash
by liverpole (Monsignor) on May 12, 2007 at 14:13 UTC | |
Re: printing refence of hash inside a hash
by shmem (Chancellor) on May 12, 2007 at 09:34 UTC | |
Re: printing refence of hash inside a hash
by RL (Monk) on May 12, 2007 at 16:08 UTC |
Back to
Seekers of Perl Wisdom