CGI::Application creates the http headers for you. Two possible solutions
- don't bother creating your own header,
- if you really do want to create your own header, add the following to each run mode you want to create your own header (or in sub setup for all run modes):
my $self = shift;
$self->header_type('none'); #suppress CGI::App's header
If you want to modify CGI::Application's header, look up header_props in the module's documentation.