in reply to PERL and HTML

You could generate the HTML either through routines provided by CGI or you could use a template system like HTML::Template.

If you run the scripts externaly, you can check their exit status by looking at $?.