if ($choice ne 'a', 'r', 'o', 'd', 'e') { print "Invalid choice, TRY AGAIN!\n"; } #### # Very explicit: if ($choice ne 'a' && $choice ne 'r' && $choice ne 'o' && $choice ne 'd' && $choice ne 'e') { print "Invalid choice, TRY AGAIN!\n"; } # Testing if the element is in a List of options: unless ( grep { $_ eq $choice } ('a', 'r', 'o', 'd','e') ) { print "Invalid choice, TRY AGAIN!\n"; } # Testing if the element matches a regular expression: unless ( $choice =~ /^(a|r|o|d|e)$/ ) { print "Invalid choice, TRY AGAIN!\n"; }