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.
#!/usr/bin/perl
my $request = shift;
$request->send_http_header('text/plain');
$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