in reply to Order of output when switching filehandles

Have you considered using IO::Tee instead of launching tee as separate process?
#!/usr/bin/perl -w use strict; use IO::Tee; open FH,">somefile" or die "error opening $!"; my $tee=IO::Tee->new(\*STDOUT,\*FH); select $tee; print "foo\n"; print "bar\n"; close FH;

Replies are listed 'Best First'.
RE: Re: Order of output when switching filehandles
by Cirollo (Friar) on Aug 14, 2000 at 23:45 UTC
    I considered that, but the machine I'm using does not have IO::Tee installed on it, so launching it as a seperate process is easier for all parties involved - it might not be the "right way" to do it, but theres no reason for it to not work and security is not a concern.