Is the template much more complex than the example you provide? If not, you could just concatenate the strings, i.e.
Alternately, you could just use HTML::Template to do this same task:$top_of_template = qq( <html> <head> <title> test </title> </head> <body bgcolor='red' > ); $bottom_of_template = qq( <table> <tr colspan='2'> <td> text </td> <td> text2 </td> </tr> </table> </body> </html> ); $middle_of_template = (your code); $output = $top_of_template . $middle_of_template . $end_of_template;
<errors> <TMPL_IF NAME="INVALID_WIDGET_SIZE"><TMPL_VAR NAME="INVALID_WIDGET_SI +ZE"></TMPL_IF> <TMPL_IF NAME="INVALID_WIDGET_COLOR"><TMPL_VAR NAME="INVALID_WIDGET_C +OLOR"></TMPL_IF> </errors>
and then just pass the invalid widget color (or any other variable you'd like) (instead of a simple boolean?) and not have to worry about dealing with XML::Simple and all of its nastiness.
In reply to Re: XML::Simple problem, or How to convert HTML to Perl and then back again.
by saintbrie
in thread XML::Simple problem, or How to convert HTML to Perl and then back again.
by Wonko the sane
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |