Pull requests

#13 Declined
tobyink/p5-xml-libxml p5-xml-libxml
shlomif/perl-XML-LibXML perl-XML-LibXML

overload array derefand hash deref for XML::LibXML::Element

  1. Toby Inkster

This allows:

foreach my $child (@$element) {

to work. And also allows you to replace:


with the much shorter:

  • Learn about pull requests

Comments (1)

  1. Shlomi Fish repo owner

    Hi Toby,

    first of all, I should note that you forgot to add the new file to the MANIFEST (maybe I should get my act together and define a MANIFEST.SKIP file).

    In any case, I'm not sure I like the direction of this patch. There may be several ways to interpret hash ref and array ref overloading in the context of XML, and while this patch appears to be convenient, it may be deceptively misleading.

    Did you think what would happen if the user tries to access a non-existing slot in the array/hash? Is it a read-only interface or can I also write? I also don't like the XML-Simple-like feel of it.

    I will still consider it because it seems convenient, but first:

    1. Add the file to the MANIFEST.

    2. Provide some examples in the documentation (like the illustrative ones in the pull request).

    3. Add a comment to the Changes file.