How have you configured apache to call your CGI? If you are for example using Apache::Registry as a perl-handler
then you might have more luck using the apache request object. Scripts launch by Apache::Registry get passed this as their first (subroutine) arg.
my $request = shift;
$request->print( $request->content() );
Which I have not tested but should do the trick for you. Read up on the CPAN about Apache modules
I can't believe it's not psellchecked