in reply to How can I modify received socket messages in Perl?

then I can insert 3 bytes to @msg using splice(). However, I don't know how to pack the message in @msg into a scalar(such as $buffer) and send it to another socket by syswrite().
$bytes = "\0\0\0"; $buffer = $bytes . $buffer;
syswrite