use strict; use warnings; use constant MAXBYTES => scalar 5; my $result; $| = 1; MSG: print "Please be aware maximum length 255 characters!:\n"; do { print "Send this text to clients:\n\n"; chomp ($result = ); if (length($result) >= MAXBYTES) { print "\nYou have reached the limit of characters ".length($result)."!\n\n"; goto MSG; } } until ($result eq "END" or $result eq "end"); $| = 1;