I'm talking more about situations where I'm manipulating binary data, and I don't want Perl even looking at the data and trying to guess what it is.
Me too. Perl never guesses "what it is". It has no way of doing that.
Instead of going through every single record in the file and unpacking the whole thing, it is often more efficient to use substr to get the few bytes i actually care about, and work with those.
You don't need use bytes; to do that. It does nothing.
use Test::More tests => 4;
my $bin = join '', map chr, 0..255;
utf8::downgrade $bin; # One internal format
no bytes;
is(substr($bin, 100, 5), "\x64\x65\x66\x67\x68", 'no bytes, UTF8=0');
use bytes;
is(substr($bin, 100, 5), "\x64\x65\x66\x67\x68", 'use bytes, UTF8=0');
utf8::upgrade $bin; # Other internal format
no bytes;
is(substr($bin, 100, 5), "\x64\x65\x66\x67\x68", 'no bytes, UTF8=1');
use bytes;
is(substr($bin, 100, 5), "\x64\x65\x66\x67\x68", 'use bytes, UTF8=1');
1..4
ok 1 - no bytes, UTF8=0
ok 2 - use bytes, UTF8=0
ok 3 - no bytes, UTF8=1
ok 4 - use bytes, UTF8=1
hum, I expected the last to fail. I have some details about bytes wrong. It might be less harmful than I thought, just more useless.