The answer to your question of "why" depends on how deep of an answer you're looking for.
On the deepest level, I'm not even going to pretend to look at the XML::Twig code (or any of the miriad of levels of code under it). So, no, no ideas why from that level.
From a higher, XML::Twig-is-a-black-box level, how I got this answer was from playing with the code. First thing I did was comment out the twig_print_outside_roots => 1, line. That showed me the reason why you put it in in the first place: all of a sudden, everything outside of the body tag stopped being printed. That gave me the idea to try adding a new root such that everything would be in it - then you don't have anything outside of the roots (so that line is no longer really needed... I think). Since 'html' is the root of everything, I figured it would be the appropriate root to use. At this point, the question is: what do we want to do with that root. The answer is simple: nothing. And that's what I told perl: do nothing.
Does that help answer the question?
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, 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, 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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.
|
|