in reply to 'Multi-Dimensional' Hash
#!/usr/bin/perl use strict; use warnings; my $characters = { 'Apple' => { 'fruit_id' => '0' }, 'Orange' => { 'fruit_id' => '0' }, }; while( my ($fruit_name) = each %$characters) { print "$fruit_name\n"; }
I get output
Apple Orange
which I assume is what you want. This is pretty much cut-and-paste from what you posted, so I'm not sure where your actual code has gone wrong. Perhaps your XML reader is not returning what you think? Tips include the friendly perlref, perlreftut, perllol, and perldsc.
|
|---|