perlquestion
rob_au
<p>I am looking for some feedback on the best way to approach a particular function which I am seeking to implement. I need to modify some existing HTML documents to add a small portion of HTML immediately before the <code></body></code> tag within these documents, but do not want to otherwise modify the layout or structure of the HTML document.</p>
<p>The Apache::Footer example module outlined in Lincoln Stein's Cool Tricks With Perl and Apache (Perl Conference 1998) uses a simple regular expression to insert HTML content immediately before the <code></body></code> tag - See this code [http://stein.cshl.org/~lstein/talks/perl_conference/cute_tricks/mp_footer.html|here]. I am however concerned about the application of this method across the wide range of HTML documents involved (which may include example HTML within <code><pre></pre></code> tags).</p>
<p>The alternate approach which I have considered is using one of the [cpan://HTML::Parser] modules to step through the HTML tokens, but am concerned about modifying the layout and structure of HTML documents.</p>
<p>Any other suggestions or approaches which I should consider?</p>
<div class="pmsig">
<div class="pmsig-65703">
<p> <p>
<tt><font size="-1">perl -le "print unpack'N', pack'B32', '00000000000000000000001011011101'"</font></tt>
</div></div>