You have text you need to serialize into bytes. The process is called encoding.
Or if the only thing you transmit on the socket is text, you could use binmode to add an :encoding layer.print $socket encode('UTF-8', $text);
Are there any circumstances where pack('a*', $payload) does not give the same value was $payload?
Since you're talking about internal storage formats, yes.
$_=5; # IV -> PV $_="abc"; s/.//; # OOK=1 -> OOK=0
Why is the OO binmode method available for IO::File but not IO::Handle? Is it not applicable to all handles?
Weird. It makes no sense to me either. binmode doesn't apply to Dir handles, but IO::Handle is not a base class of IO::Dir, and the other methods of IO::Handle don't apply to directory handles either.
In reply to Re: The utf8 flag and print()ing binary data
by ikegami
in thread The utf8 flag and print()ing binary data
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |