in reply to Re^2: Porting Perl 5.6 to Perl 5.8 issue with self-tie
in thread Porting Perl 5.6 to Perl 5.8 issue with self-tie

Hi shmem,

I tried this scheme on my system. It ran into the same issue I had when trying the example out of the O'Reilly book. The first log works great, but the second log attempt results in the following error at the first print statement: tee: write error: Invalid argument

Are you running this on 5.8? Could there be an issue with my 'tee'?

Thanks - Rick

Replies are listed 'Best First'.
Re^4: Porting Perl 5.6 to Perl 5.8 issue with self-tie
by shmem (Chancellor) on Dec 14, 2006 at 18:39 UTC
    Hmm. Yes, I'm running 5.8, and no, I guess it's not an issue with tee. Strange.

    Next I would do is wrapping tee with a shell script which traces tee, to see what it does, specifically open/closes. Log the fileno() of your STDERR and STDOUT to the apache error log (real STDERR ;-) as well as the fileno() of your redirected handles. Ah, and you could omit the close STDOUT - just re-open it. I didn't check the return value of close (shame on me) which you should do.

    Could you provide a condensed version of the code you are running?

    --shmem

    _($_=" "x(1<<5)."?\n".q·/)Oo.  G°\        /
                                  /\_¯/(q    /
    ----------------------------  \__(m.====·.(_("always off the crowd"))."·
    ");sub _{s./.($e="'Itrs `mnsgdq Gdbj O`qkdq")=~y/"-y/#-z/;$e.e && print}