Apple, in their infinite wisdom, has broken SysV IPC (including semaphores, etc). This means that IO::File does not compile properly for me.
IO.xs: In function `XS_IO__Seekable_getpos': IO.xs:208: `sv_undef' undeclared (first use in this function) IO.xs:208: (Each undeclared identifier is reported only once IO.xs:208: for each function it appears in.) IO.xs: In function `XS_IO__File_new_tmpfile': IO.xs:252: `sv_undef' undeclared (first use in this function) make: *** [IO.o] Error 1
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:

open FIFO, "<foo" or die "$!\n"; while (<FIFO>) { chomp; print "$_\n"; open FIFO, "<foo" or die "$!\n"; }
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:

foreach word (foo bar baz bletch quux qip qua) echo $word > foo end
(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.

Thanks,
brother dep

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.

--
Laziness, Impatience, Hubris, and Generosity.


In reply to Improvised pipes (code) by deprecated

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.