Not so much a suggestion as a question arising... Is there any particular reason for using temporary vars as opposed to say
use CGI qw/:standard/;
my ( $name ) = (param('name') || '') =~ /^([[:alpha:][:punct:][:s
my ( $color ) = (param('color') || '') =~ /^([[:alpha:]]+)$/;
encode_entities( $name );
print header, <<"END_HTML";
<p>Your name is "$name" and the color you listed was "$color"</p>
Cor! Like yer ring! ... HALO dammit! ... 'Ave it yer way! Hal-lo, Mister la-de-da. ... Like yer ring!