my $q= new CGI; print $q->header; print "error text"; #stop the script going any further die "something bad happened;