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 </body> tag within these documents, but do not want to otherwise modify the layout or structure of the HTML document.
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 </body> tag - See this code 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 <pre></pre> tags).
The alternate approach which I have considered is using one of the HTML::Parser modules to step through the HTML tokens, but am concerned about modifying the layout and structure of HTML documents.
Any other suggestions or approaches which I should consider?
perl -le "print unpack'N', pack'B32', '00000000000000000000001011011101'"
In reply to HTML document modification by rob_au
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |