if ( /^[brc]at$/ ) { # match "bat", "rat", or "cat" print "It's an animal\n"; if ( /^b/ ) { print "... and it flies!\n"; } }