in reply to Validation in forms using Perl

You can alert them in the next page by outputting an error instead of whatever else you would have put there if everything had gone according to plan.

This may or may not be really obvious, but I think it has to be mentioned in this thread: print is all you really need.

my $error = "Generate your error message here"; print <<EOF; Content-Type: text/html Error: $error EOF