Example:
my $page = $args{'p'};
exit 1 if $page =~ /[^\d\w]/;
print "Content-Type: text/html\n\n";
print "<html><head></head><body>";
require "$page.pl";
somefunc();
print "</body></html>";
Is there anything wrong with using the require after the output has started or should all requires be at the top of the script?