in reply to Re^4: How can I modify received socket messages in Perl?
in thread How can I modify received socket messages in Perl?

I doubt it's necessary or even helpful to create @msg.

And populating it with the hex nibble pairs is particularly backwards. Populating it with the values of each bytes would make more sense if there's any reason to create @msg in the first place.

my @msg = unpack('C*', $buffer); ...do something to @msg... $buffer = pack('C*', @msg);