in reply to HTML Problem getting entities into a textarea

Like tye said, use a tool to do this, and a good alternative to CGI.pm is HTML::Template. The <tmpl_var> tag has an option attribute named escape that, when set to html, will solve this problem in a very painless way for the coder. Here is a complete CGI script to demonstrate:
#!/usr/bin/perl -T use strict; use warnings; use CGI qw(header param); use HTML::Template; my $tmpl = HTML::Template->new(filehandle => \*DATA); $tmpl->param(html => param('html')); print header, $tmpl->output; __DATA__ <html> <head> <title>textarea test</title> </head> <body> <form> <textarea name="html"><tmpl_var name="html" escape="html"></textarea> <input type="submit" /> </form> <hr /> <p><tmpl_var name="html"></p> </body> </html>
Be sure and view the source and inspect the contents of the textarea element.

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)