in reply to Re^2: HTML::Element accessing "internal attributes" the proper way
in thread HTML::Element accessing "internal attributes" the proper way

I said "might" because I was not sure off the top of my head whether reading off the end of a list produces a warning in Perl or not.

As the documentation says, content_array_ref is just as deprecated as content, with content_list being the preferred interface for new code.

Replies are listed 'Best First'.
Re^4: HTML::Element accessing "internal attributes" the proper way (updated)
by LanX (Saint) on Dec 26, 2020 at 02:54 UTC
    > As the documentation says, content_array_ref is just as deprecated as content

    Not really, I can't see this in the documentation.

    And the author seems to be a bit confused about the inner mechanics of Perl.

    update

    After further reading. .. the issue seems to be that the ref returned is the one of an internal attribute _content , which "still" allows direct write access to children elements, but that's strongly discouraged.

    But as long as you are only reading and not writing, I can't see a reason to deprecated the whole method.

    Cheers Rolf
    (addicted to the Perl Programming Language :)
    Wikisyntax for the Monastery