in reply to Apache log pipe doesn't write to log files
Are the files completely empty, or is there a blank line? You're overwriting the combined log file, not appending to it, which may be part of the problem. You will also run into trouble if a line evaluates to false. I'd probably write:
open( my $fh, '>>', '/var/tmp/test.log' ) or die "Cannot open file: $! +\n"; select $fh; print while <STDIN>;
That's untested, and it requires Perl 5.6.0 or better.
|
|---|