for (@labsets) { if ($_ ~= /^lab\d{1}/) = [some condition] { print "$_ matched\n!" } else { print "print $_ did not match\n"; }