... local $/=\nn; # big chunks, small chunks whatever open FH, '< copy bigbinary con |' or die $!; while() { binmode(FH); # do whatever. }