open my $f,"<:raw","file.csv" || die $!; my $c; for (1..8) { for (1..16) { read $f,$c,1 || exit 0; print unpack "H2",$c; } print "\n"; }