for (qw/green blue red/) { if ($color eq $_) { ... } } for each of green, blue and red: if the color is it, do something #### for (qw/green blue red/) { if ($_ eq $color) { ... } } for each of green, blue and red: if it is the color, do something