my $buf = pack( 'NA*', length( $msg ), $msg ); #sender my ($len_msg,$msg) = unpack('NA*',$buf);#receiver