perl -l
# make these colours exist as keys in the %colours hash my @colours = qw/red green blue/; my %colours; @colours{@colours} = ();
if ( exists $colours{$a_colour} ) { ... }