in reply to XML::Simple parsing :-(

I'll be glad to help, but you should print your data with less indentation so it doesn't scroll off to the right. Printing it as YAML instead of Data::Dumper should make it a lot clearer, too, besides cutting down on the ultra-indent.

update: Oh, and you should include the original XML and the code you wrote that reads it with XML::Simple. That's quite important, you know. We don't know what you did wrong until we know what you did.

    -- Chip Salzenberg, Free-Floating Agent of Chaos

Replies are listed 'Best First'.
Re: Re: XML::Simple parsing :-(
by bobn (Chaplain) on Jun 20, 2003 at 03:12 UTC
    Print the structure in YAML for debugging? IMHO, I don't think so.

    The indentation problem of Data::Dumper is fixed with $Data::Dumper::Indent = 1; - not by using some other format that I'll bet most of us don't know. (After all, we know how to read perl hashes!) I don't know YAML, and given that XML is now Lingua Franca, I doubt I'll be learning it.

    (And how would he produce the YAML output, assuming the modules exist, when his problem is that he can't get the XML to parse the way he wants? Another module to learn?)

    --Bob Niederman, http://bob-n.com

      For what it's worth: YAML output looks very much like Data::Dumper output, but it is a lot more compact. In other words: you don't really need to "learn" YAML to read its output. I consider that it just makes more sense in most case to use YAML than to use Data::Dumper for debugging.

      BTW, learning enough about YAML to be able to use it for debugging would probably have taken you less time that writing this post (and wouldn't have resulted in --'s ;--).