in reply to RFC: Hash::CamelCase

What happens if you have CamelCase and camel_case tags in the same document?

print _internalize('camel_case'), " ", _internalize ('CamelCase');

Prints:

camel_case camel_case

DWIM is Perl's answer to Gödel

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

    I think you already answered the question.

    Yes, that is problematic, but also expected: isn't this what the module expressly promises to do? Consider the two equivalent? From that point of view, there is no problem. The module works!

    The XML 1.1 specification seems to allow element and attribute names in almost any form imaginable (curiously, also Unicode 3.0 characters), but I don't intend to use this module in arbitrary XML documents. The schema of the document(s) that I intend to process define lowerCamelCase element and attribute names, and I simply want to work around having to call _internalize (or a similar method) on all key names manually. In some sense this is laziness.

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