Beefy Boxes and Bandwidth Generously Provided by pair Networks
Syntactic Confectionery Delight

Re: Waiting for a file to be written

by jethro (Monsignor)
on Oct 14, 2008 at 13:28 UTC ( #716981=note: print w/replies, xml ) Need Help??

in reply to Waiting for a file to be written

Sorry to tell you, but you are suffering from buffering ;-). Tie::File has its own buffering scheme (which I found out simply through reading the man page of Tie::File). Look for "Deferred Writing". The solution is to use the flush method of Tie::File at appropriate moments or turn of the buffer completely with tie @array, 'Tie::File', $file, autodefer => 0;.

UPDATE: moritz has the right answer. You might think about using a different copy of the file for each of the subprocesses, if your file isn't too big

Replies are listed 'Best First'.
Re^2: Waiting for a file to be written
by why_bird (Pilgrim) on Oct 14, 2008 at 13:57 UTC
    Thank you, this was the information I was hoping for, until Moritz pointed out that it was not in fact the information I needed. Damn buffering!!
    Those are my principles. If you don't like them I have others.
    -- Groucho Marx

Log In?

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://716981]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (1)
As of 2023-06-01 18:59 GMT
Find Nodes?
    Voting Booth?

    No recent polls found