in reply to Re^4: Capturing all (and I mean all) output to a file
in thread Capturing all (and I mean all) output to a file

No but

open STDERR, ">&", $tee;
will.

/J\

Replies are listed 'Best First'.
Re^6: Capturing all (and I mean all) output to a file
by flippy (Novice) on Jan 12, 2005 at 12:01 UTC

    I'm getting

    Unknown open() mode '>&'

    old version of perl (5.6), perhaps?

    None of the other open modes work either.

      It could be a version thing (I don't have 5.6 available to test with at the moment.) Does:

      my $foo = fileno($tee); open STDERR, ">&$foo";
      work ?

      /J\

        I guess IO::Tee objects aren't interpreted as filehandles...? I'm a complete newbie to module coding/OO Perl, so I have no idea why it's looking for an object method rather than using the builtin fileno() function...

        Can't locate object method "FILENO" via package "IO::Tee" (perhaps you forgot to load "IO::Tee"?)
        As IO::Tee extends IO::Handle, should't I be able to call IO::Handle methods like IO::Handle::fileno on IO::Tee objects? Or does IO::Tee need to explicitly state which methods it inherits? (with apologies for any dodgy terminology)