in reply to RFC: Hash::CamelCase

I don't think I'd use the module. In my opinion it adds too much overhead with too small gain.

I'm working on a program that reads in XML files, and while at it, I need to save XML elements and their values in a Perl hash. The elements in the hash are not simply DOM trees, but attempt to be a bit more usable.

How do you do it? This looks like a perfect case for XML::Rules.

Replies are listed 'Best First'.
Re^2: RFC: Hash::CamelCase
by vrk (Chaplain) on Mar 02, 2007 at 18:17 UTC

    I didn't notice XML::Rules last time I browsed CPAN. Thanks for the tip. I'm currently using XML::Twig, for two reasons.

    • The files I have do not fit into main memory. (Well, they would, if I bought another gigabyte of RAM.) XML::Twig is able to parse the file one part at a time, without loading it all in at once.
    • I like the concept of twigs much more than SAX.

    Another gain is that (as with SAX?) I can store the absolute byte position of where certain elements start and where they end, by defining a start_twig_handler and calling current_byte, which is defined in XML::Parser::Expat. I am using this to load big data chunks from the file on-demand. The data chunks are the real culprits in why I can't read in the whole file at once. Storing hundreds of megabytes of base64 encoded binary data in an XML file is not my idea, though... But I have to live with it.

    Anyway, this is going too much on a tangent. I'm beginning to think Hash::CamelCase is pretty useless. Maybe I should move the module to the Acme namespace.

    --
    print "Just Another Perl Adept\n";