You can keep a stack of the current level where you are
in the XML file. When you get a start tag, push the
tag onto the stack; when you get to the end of that tag,
pop the tag off the stack. You can use this to define a
tree structure of sorts.
Another option would be to use the "Tree" Style of XML::Parser.
Read the docs for that.
A final option, and a good one, is to use XML::Simple,
which may work for you:
It loads the data into a tree structure, which may or may
not work exactly how you want it.
Or (finally again) you could look into some of the other
tree-processing XML modules, like XML::DOM and XML::Twig.
They may be overkill for your purposes, though.
Are you posting in the right place? Check out Where do I post X? to know for sure.
Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
<code> <a> <b> <big>
<blockquote> <br /> <dd>
<dl> <dt> <em> <font>
<h1> <h2> <h3> <h4>
<h5> <h6> <hr /> <i>
<li> <nbsp> <ol> <p>
<small> <strike> <strong>
<sub> <sup> <table>
<td> <th> <tr> <tt>
Snippets of code should be wrapped in
<code> tags not
<pre> tags. In fact, <pre>
tags should generally be avoided. If they must
be used, extreme care should be
taken to ensure that their contents do not
have long lines (<70 chars), in order to prevent
horizontal scrolling (and possible janitor
Want more info? How to link
or How to display code and escape characters
are good places to start.