Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re^2: Buffered IO and un-intended slurping

by Wiggins (Hermit)
on Jan 02, 2010 at 14:31 UTC ( [id://815299]=note: print w/replies, xml ) Need Help??


in reply to Re: Buffered IO and un-intended slurping
in thread Buffered IO and un-intended slurping

There was no mixing of buffered and unbuffered on a file. It all started out buffered; after the lost positioning I converted all the IO calls to unbuffered for that file.

41 is the record size... 40 bytes for the SHA1, 1 byte for the newline .... 40+1=41. I never even touch the $/ value in the program

And keep in mind that this happened just 1 in a 1000 times this module was called.

It is always better to have seen your target for yourself, rather than depend upon someone else's description.

  • Comment on Re^2: Buffered IO and un-intended slurping

Replies are listed 'Best First'.
Re^3: Buffered IO and un-intended slurping
by dk (Chaplain) on Jan 03, 2010 at 10:56 UTC
    If, as you say, you never mix buffered and unbuffered I/O, and never alter $/, then there's something fishy and unexpected. I sincerely doubt that seek() calls, even if done on a buffered stream and even with mixed dos and unix newlines, would produce such an effect. I'd investigate further to find what causes the slurping, at least to make clear if that's a perl bug or not.

    otoh, if you're only interested in a practical solution, just switch to read($f, $buf, 41) instead of readline, which depends on $/.

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2024-04-23 18:47 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found