use warnings; use strict; my $hand = 'defgh'; my @tests = ( qr/abcde/, qr/bcdef/, qr/cdefg/, qr/defgh/, ); for my $test (@tests) { if ($hand =~ /$test/) { # do stuff # print "Got a straight\n"; } }