i am trying to get my mind around the concept of open2 which is..
open2( /*MYSTDIN, /*MYSTDOUT, "myprog");
how do i simply read to the program and write to the program..
is it just...
print MYSTDIN, "my data\n";
and then a ..
while(MYSTDOUT) {
...
}
I think you will
Below I'm asking what are common ways to do a few things with log files
written by a Registry script.
In summary:
- does opening a file once per child save much time over once per request?
- is writing to a log file without locking crazy?
- what's a good way to gzip and purge live log files?
In a Registry script I open a file the first request and set a global
variable flag. Then for each request I just flock( FH, LOCK_SH ) and
flock( FH, LOCK_UN).
The only problem I see is that if the lock isn't released I need to do
a graceful restart to get rid of that lock. (But that
At 02:40 PM 12/19/99 -0400, Eric L. Brine wrote:
How about:
sub cleanup {
flock(FH, LOCK_UN);
}
$SIG{__DIE__} = sub {
cleanup();
die($_[0]);
};
END { cleanup(); }
You'll never been able to write to the file if you don't unlock a shared
lock.
Oh, I do LOCK_SH and LOCK_UN
Hi Bill,
On Sun, 19 Dec 1999, Bill Moseley wrote:
Can anyone recommend a good method to archive a log file
There's loads of stuff for managing logfiles knocking about.
I know you said you'd looked at the Guide, but what was the version
you last downloaded? There's a bit in control.pod
I'm glad to announce a new version of the guide:
http://perl.apache.org/guide/
As usually comments are very welcome!!!
The Changes:
* all.html has gone (all htmls in one) -- it became more than 1Mb, too
big - use the PS version instead
* reorg: moved the "perl reference" chapter to be one
Thanks for the answers!
I was using RedHat rpm and it was giving the problem
as it was suggested. After I built mod_perl with apache
(mod_perl 1.21, apache 1.3.9, the problem was resolved.
At least that's what I thought !
In fact now Apache lets me use more then one
PerlTransHandler, but it