Learning from Perl Golf (I) 

# 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} ) {
   ...
}