in reply to how to get the number of elements with XML::Smart

Dump $offers with Data::Dump::Streamer (preferred) or Data::Dumper to see how that structure is organized. I guess your [$i] is bogus, but I can't tell without sample data.

You could stuff a dump of insensitive data into your scratchpad for further examination, and ask in the chatterbox...

--shmem

_($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                              /\_¯/(q    /
----------------------------  \__(m.====·.(_("always off the crowd"))."·
");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}

Replies are listed 'Best First'.
Re^2: how to get the number of elements with XML::Smart
by makrospex (Initiate) on Jul 20, 2007 at 10:28 UTC
    Hi shmem,

    as the scalar() always returns 1 i now check with XML::Smart::null() for child elements of a node in the XML String ($offers as XML::Smart object).

    if null() returns true, i set $num to zero; else i get the correct number of child elements from scalar();

    many thanks anyway!

    regards,
    makro