in reply to Re^2: have cgi send data back to form on error
in thread have cgi send data back to form on error

print <<ENDHTML can work here as well. Since Perl interpolates strings, just stick the variables you want in the appropriate places like:
use HTML::Entities; my $email = $q->param('email'); $email = encode_entities($email); print <<ENDHTML; <input type="text" name="email" value="$email"> ENDHTML