in reply to Outputing HTML files

Before your big set of if statements, you probably want to start the page. This way you won't have to do it for each if. Then you want to end it after the ifs. So you end up with code like:
#!/usr/bin/perl -w use strict; use CGI ':standard'; my $agentname = param('agentname') || 'default'; print header(), start_html( -title => 'Joe Bob' ); if( $agentname eq 'Joe Bob' ) { print h1( 'Header for Joe Bob' ), p( 'Text for Joe Bob' ); } else #default { print h1( 'Default' ); } print end_html();