#!/usr/bin/perl use strict; use warnings; my $msg = "This is just a sample of message."; my $length = length($msg); my $number = length($length); print "\$number: ".$number."\n"; my $transmit = $length . " " . $msg; print "\$transmit: ".$transmit."\n"; my $receive = substr $transmit, 3; print "\$receive: ".$receive."\n"; __END__ $number: 2 $transmit: 33 This is just a sample of message. $receive: This is just a sample of message.