I understand that both Java and Perl try quite hard to find a one-size-fits all default buffer size when reading in files, but I find their choices to be increasingly antiqu
I'm necroposting since this came up on this perlmonks thread
It's not possible to use setvbuf on perls using PerlIO, which the default since version 5.8.0. However, there is the PerlIO::buffersize module on CPAN that allows you to set the buffer size when opening a file:
open my $fh, '<:buffersize(65536)', $filename;
IIRC, you could also set the default for any new files by using this at the beginning of your script:
use open ':buffersize(65536)';