in reply to not well-formed (invalid token)

Looks like a cut-n-paste error :-)

In the four places that you have:

my $cat = (<DATA>);

Change it to:

$cats = (<DATA>);

Regards,

PN5

Replies are listed 'Best First'.
Re^2: not well-formed (invalid token)
by Maxim (Sexton) on Oct 04, 2004 at 08:42 UTC
    It won't work what you suggest but I found the error from a FAQ. It is from the encoding declaration. XML::SIMPLE doesn't like this:
    <?xml version='1.0' encoding="iso-8859-1"?>

    But he likes this:
    <?xml version='1.0' encoding='iso-8859-1'?> or <?xml version="1.0" encoding='iso-8859-1'?>

    Very tricky. Becareful of the encoding guys

      I'm not sure if you're aware of the pointless processing occurring at these four lines. The data assigned to $cat are immediately lost because this variable immediately goes out of scope. This may not be a typo, as I suggested, but it is definitely an issue you should address.

      The problem you describe with XML::Simple indicates non-conformance with the published XML Specification. If you are absolutely certain about this, consider advising the module's author(s).

      Regards,

      PN5

        I already replaced what you just suggest to me before I came back here and worked well. But XML::simplestill complains about the encode. So since I found what was the prob about the encode and after I debugged. It's good now.
        But Thanks for you suggestion. I appreciate. :)
        Maxim