cfan
08-04-2006, 06:17 AM
Hello,
I'm trying to extract useful data from a hash table that was returned by the Xerces P XML parser. Unfortunately, it contains lots of nested hashes, references, and arrays, and I'm getting lost in a sea of punctuation marks. Specifically, why am I able to do something like this:
$fileName = $hash->{"children"}[0]->{"children"}[$i]->{"text"};
for $i = 0..5, but when I write
my @arr = $hash->{"children"}[0]->{"children"};
print scalar(@arr) . "\n";
the output is 1? How do I get this to return the correct value of 6? (Right now, the iteration is just hard-coded, but I'd obviously like to make the length variable).
Thanks!
I'm trying to extract useful data from a hash table that was returned by the Xerces P XML parser. Unfortunately, it contains lots of nested hashes, references, and arrays, and I'm getting lost in a sea of punctuation marks. Specifically, why am I able to do something like this:
$fileName = $hash->{"children"}[0]->{"children"}[$i]->{"text"};
for $i = 0..5, but when I write
my @arr = $hash->{"children"}[0]->{"children"};
print scalar(@arr) . "\n";
the output is 1? How do I get this to return the correct value of 6? (Right now, the iteration is just hard-coded, but I'd obviously like to make the length variable).
Thanks!