in reply to who's bug is it anyway? (how to bring a linux box to it's knees)

rhesa's advice is good, I think, but apart from that...

If you know your "buffer_read" thingie is going to be getting data of arbitrary (potentially extreme) length with no line terminations, you should be using the "read()" or "sysread()" function, not the diamond operator (which in your case is implied by the "-n" option). Pick a buffer size that suits your taste and "memory budget", and just read that many bytes at a time.

(There's also a way to set $/ (input record separator) to a numeric value -- e.g.  $/ = \8192; -- so that the diamond operator just reads a fixed number of bytes on each iteration.)

  • Comment on Re: who's bug is it anyway? (how to bring a linux box to it's knees)
  • Download Code