in reply to Problems with Filehandles and TeeOutput
Looking at the source, the inputs to openTee must be a glob (ref(\$file) eq 'GLOB'), a string expression starting with ">" or ">>", or a file name (opened for append).
Based on some quick testing (without the module), all of these should work
local *LOG; open(LOG, '>>test.out'); openTee(*STDOUT, *STDOUT, *LOG); my $fh = IO::File->new(">>test.out"); openTee(*STDOUT, *STDOUT, *$fh); open(my $fh, '>>', 'test.out'); openTee(*STDOUT, *STDOUT, *$fh); openTee(*STDOUT, *STDOUT, '>>test.out'); openTee(*STDOUT, *STDOUT, 'test.out');
By the way, why do you want to use IO::File instead of open anyway?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Problems with Filehandles and TeeOutput
by hkpatv (Initiate) on Aug 26, 2008 at 05:24 UTC | |
by ikegami (Patriarch) on Aug 26, 2008 at 05:56 UTC | |
by hkpatv (Initiate) on Aug 26, 2008 at 09:24 UTC | |
by ikegami (Patriarch) on Aug 26, 2008 at 18:08 UTC | |
by massa (Hermit) on Aug 26, 2008 at 09:41 UTC | |
by ikegami (Patriarch) on Aug 26, 2008 at 17:27 UTC | |
by hkpatv (Initiate) on Aug 27, 2008 at 01:33 UTC |