in reply to Unnesting deeply nested HTML elements (Deep recursion on subroutine "HTML::Element::delete")

G'day mldvx4,

Look at perldiag: Deep recursion on subroutine "%s". Notice the value of 100 there.

You have 102 levels of <center>...</center> nesting. Try reducing that to below 100 and see if there's any difference. Keep reducing until the warning stops: the recursion:nesting ratio may not be 1:1. You also have a couple of other levels with <html>...</html> and <body>...</body>.

If you really do need what you've shown, you'll have to recompile Perl with PERL_SUB_DEPTH_WARN set to an appropriate number. You might want to look at Perlbrew to compile a separate installation for this task.

See also: "Deep Recursion Limit".

— Ken

  • Comment on Re: Unnesting deeply nested HTML elements (Deep recursion on subroutine "HTML::Element::delete")
  • Select or Download Code