in reply to Test for array or hash - ok, but what to do about it?

use option ForceArray=>1 that ways you always use ->{A}[0]

Replies are listed 'Best First'.
Re^2: Test for array or hash - ok, but what to do about it?
by Jenda (Abbot) on May 17, 2009 at 21:46 UTC

    That would force you to handle all tags as arrays, including those that are never repeated. It's better to specify what tags can be repeated in ForceArray => [qw(A B D)]. Or use XML::Rules that gives you even more detailed control.

    Jenda
    Enoch was right!
    Enjoy the last years of Rome.