http://www.perlmonks.org?node_id=1121697


in reply to Character in 'b' format wrapped in unpack

Did the shifting manage to create a wide character?

It's not the shifting per se that creates the wide character; when you pass a numeric value greater than 255 to chr, it must return a wide character.

(I'm afraid I don't quite understand the reason(s) for what happens when the "use bytes" pragma is added -- if I've done it right, the only difference is to eliminate the warning message about the "wrapped character in unpack"; the resulting output is not changed. Is it the case that you got the particular pattern of zeros and ones you expected, and were just complaining about the warning message?)