|Perl: the Markov chain saw|
Improvised pipes (code)by deprecated (Priest)
|on Nov 09, 2001 at 06:38 UTC||Need Help??|
deprecated has asked for the
wisdom of the Perl Monks concerning the following question:
Apple, in their infinite wisdom, has broken SysV IPC (including semaphores, etc). This means that IO::File does not compile properly for me.
The above is what I get, if anyone cares or knows how to fix it. The above people said that PostgreSQL was fixed with a 'shim'... but all this C stuff is beyond me.
At any rate, I am using this code to poke a fifo:
Initially, I didnt have the second open. But it seemed that after it got input, it would close FIFO and crash. So the second open, I thought, would keep <FIFO> alive.
I was wrong. When I do this:
(thats csh, not perl, for the uninitiated), all I get is foo, bletch, and qip from the perl script. And randomly at that. Sometimes, I only get foo.
What I'm trying to do here is create a named pipe from which a perl script can read. I want to direct a log (such as Apache) to the named pipe and have postgres read it into a database so I can run webstats directly off of it, rather than just importing the stupid logfile into the database. That strikes me as unnecessary.
So I'd like to know if anyone has any ideas here. I thought IO::File might be able to help, but it looks like it's suffering from the same problems my named pipe is. Has anyone got another idea? Or perhaps, oh hope of hope, a fix for my IPC? (yes, I am aware there is a kernel patch, and that there is even a kext for darwin. However, I'm not going to use software that threatens it will render my baby scorch unusable!!).
Oh, and I forgot. "foo," above, is the named pipe.
one final note... i dont want to hear any jabs at apple. I'm angry enough for everyone here.
update: The fix below worked. Bueno.