in reply to Re: Formatting a large number of records
in thread Formatting a large number of records

To be honest, I have no idea what the diamond operator is doing behind the scenes (How much does it read at a time internally?), I would think there might be potentially some benefit to chunking it into an array. Not the whole thing of course but perhaps 100-500 records at a time. (It all depends I suppose on what buffer sizes IO is working with internally)

-Lee

"To be civilized is to deny one's nature."
  • Comment on Re: Re: Formatting a large number of records

Replies are listed 'Best First'.
Re: Re: Re: Formatting a large number of records
by pfaut (Priest) on Dec 30, 2002 at 14:30 UTC

    IO::Handle appears to allow access to setbuf() and setvbuf(). From the perldoc:

    If the C functions setbuf() and/or setvbuf() are available, then "IO::Handle::setbuf" and "IO::Handle::setvbuf" set the buffering policy for an IO::Handle. The calling sequences for the Perl functions are the same as their C counterparts--including the constants "_IOFBF", "_IOLBF", and "_IONBF" for setvbuf()--except that the buffer parameter specifies a scalar variable to use as a buffer. You should only change the buffer before any I/O, or immediately after calling flush.
    --- print map { my ($m)=1<<hex($_)&11?' ':''; $m.=substr('AHJPacehklnorstu',hex($_),1) } split //,'2fde0abe76c36c914586c';