use strict; my $releasing; while ($releasing !~ /[0-9][0-9]?,?|[aA],?|[0-9][0-9]?\-[0-9][0-9]?,?/) { print ("\n\nPlease type the numbers of the messages that are to be released (n-n and n \nare allowable, A for all): "); $releasing = ; chomp $releasing; }