in reply to mod_perl seems to have disappeared the open function

Since STDOUT and/or STDERR is clearly tied to Apache::RequestRec, you should probably close then untie them first. I don't have this problem in my mod_perl environment so I can't test a specific solution suggestion. Something like:

close STDOUT; untie *STDOUT; open( STDOUT, ...

- tye