Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others browsing the Monastery: (4)
As of 2024-04-16 19:07 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found