use strict; use warnings; use constant MAXBYTES => scalar 5; my $result; $| = 1; my $msg = "Please be aware maximum length 255 characters!:\n"; do { print "Send this text to clients:\n\n"; chomp ($result = ); if (length($result) >= MAXBYTES) { print "\nYour input has a length of " . length($result) . "; the limit is ". MAXBYTES, "\n\n"; print $msg; } } until (uc ($result) eq "END"); $| = 1;