for ("a".."c"){ { if ( /a/ ) { print } elsif ( /b/ ) { print } else { last } print " is in group"; # a,b } print "\n" # all }