Help for this page
# $sock is open, probably is a IO::Socket of some type my $total_read = 0; ... } full_process(substr($full_data,0,$total));
# $data has the required data and $sock is an open socket print $sock pack('N',length($data)) . $data . ("\0" x (4-(length($data +)%4)));