in reply to Re: Pack & Unpack
in thread Pack & Unpack

You should use a format like "n/A*" if your strings may have binary characters in them. But, if you do use this format, you cannot use <$socket> because the length may contain a "\n" character (e.g. if your string length is 10). You also shouldn't use <$socket> if your strings can contain arbitrary binary data which can include "\n". If you do use "n/A*", you should use read or sysread to read the data. You use the prepended length to tell when you have a complete message.