in reply to printing to STDOUT and a Logfile
If you're on a Unix-like system, you can check out the 'tee' command:
$ man tee
NAME
tee - read from standard input and write to standard out-
put and files
Another option, which I have never used, is Tie::FileHandle::MultiPlex.
Update: One way that I have used 'tee' in the past.
use constant TEE => '| tee '; use constant TO_PRINTER => "| lp -d lex_text"; my $file = REPORT_DIR . "cc_auth_$DATETIME"; open CCAUTH_REPORT, TEE . $file . TO_PRINTER or die $!;
Cheers,
Ovid
Join the Perlmonks Setiathome Group or just click on the the link and check out our stats.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: printing to STDOUT and a Logfile
by Kanji (Parson) on Oct 29, 2002 at 01:21 UTC |