in reply to Error parsing XML

You can use ref to detect the type of thing you have:

use strict; use warnings; my $array = []; my $hash = {}; print ref $array, "\n"; print ref $hash, "\n";

Prints:

ARRAY HASH

DWIM is Perl's answer to Gödel

Replies are listed 'Best First'.
Re^2: Error parsing XML
by Hammy (Scribe) on Mar 01, 2006 at 04:31 UTC
    Thank you ever so much, that did the trick.
Re^2: Error parsing XML
by grantm (Parson) on Mar 02, 2006 at 07:53 UTC
    You can use ref to detect the type of thing you have

    Yes you can, but in this case it would be better to use XML::Simple's ForceArray option to ensure that the 'Table' elements are always represented as an array. That way you use the same code to process them regardless of whether there's one or many.

    More info here.