APM: changing buffer size to a writable fh

Dennis Moore rainking at feeding.frenzy.com
Thu May 29 13:34:53 CDT 2003


On Thu, May 29, 2003 at 12:29:48PM -0500, jeremy wrote:
> Hey all,
>   I have a need to change the buffer used when writing to a file handle.
>   The handle to to a flat file.  The script dumps data to it.  ..no big
>   woop. 
> 
>  More specifically, I need to make sure that none of the  data gets
>  written to the file until the handle is closed OR until the there is no
>  more data regardless of how much data gets kept in memory.  I seem to
>  remember doing this a while back but I don't remember how.  Can someone
>  point me in the right direction?

i have a feeling you're asking the wrong question.  what is the purpose of
this behavior?   how would your program know there is no more data?  you
could just store your data in a variable and print when you're ready.  you
could also tie the filehandle.  you might also take a look at
Output::Buffer.  it looks like that one uses Tie::Filehandle::Buffer so
you'd be using tie in the end that way.

HTH

-- 
<BLINK> ;for (74,1970500640,1634627444,1751478816,1348825708,543711587,
1801810465){for($x=1<<1^1;$x>=1>>1;$x--) {$q=hex ff,$r=oct($x=~s,\d,$&*
10,e,$x),$x/=1/.1,$q<<=$r,$s.=chr (($_&$q)>>$r),$t++}}while($= ||= !$|)
{$o=$o?$?:$/;$|=1;print $o?$s:$"x$t if$;;print"\b"x$t;sleep 1} </BLINK>



More information about the Austin mailing list