in reply to Help With Parsing XML format / Hash of Hashes

OK, I played with it all day and seems to get some of the data out of those hashes by assigning variables as this:
$result = $som->paramsall; $result1 = $result->{'MisspelledWord'}; $nosuggestions = $result1->{'SuggestionCount'}; $mistake = $result1->{'word'}; $suggestion = $result1->{'Suggestions'};
I am unable to get to the $result1->{'Suggestions'} since there are so many values in it. Could someone please show me how to access this structure. Thanks.

Replies are listed 'Best First'.
Re^2: Help With Parsing XML format / Hash of Hashes
by Anonymous Monk on Nov 24, 2007 at 05:52 UTC
    e.g., to access the second element of the array of suggestions, use

    my $second_suggestion = $result1->{'Suggestions'}[1];

    to get a copy of the entire array of suggestions, use

    my @suggestions = @{ $result1->{'Suggestions'} };

    see the Perl Data Structures Cookbook perldsc for more info and related links.