Are you running this under mod_perl? There's a possiblility it's generating your headers for you and then CGI::Application is doing it again so the browser sees the mod_perl headers and you see the ones you want to send as plain text. If that's the case, take a look at the
PerlSendHeader option for mod_perl.