I think anon is telling you that you do not need to use delete at all with "modern" HTML::Element. See delete. OTOH even if you don't explicitly use delete perhaps HTML::Element will (edit: see Edit2 below), when you undef an element. And thus you will still get the warnings.

Generally, having "deep recursion" warnings is not harmful at all because you may well have a structure which is more than 100 deep. And that's fine (until your memory is exhausted). However, the real problem is whether WordPress managed to produced some HTML which parsing it causes cyclical paths somehow. Then you may get infinite recursion and that's real bad. I would investigate that before supressing the warnings.

bw, bliako

Edit: by delete I mean HTML::Element::delete()

Edit2: with weak references ON, as anon mentioned, it's the Perl interpreter/garbage collector who does the cleaning up as soon as the parent object goes out of scope or set to undef. I am trying to not give the impression that delete will be called internally with the "modern" regime.


In reply to Re^3: Unnesting deeply nested HTML elements (Deep recursion on subroutine "HTML::Element::delete") by bliako
in thread Unnesting deeply nested HTML elements (Deep recursion on subroutine "HTML::Element::delete") by mldvx4

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.