my $rain = 1; my %Weather = ( 'precipitation' => ($rain == 0) ? 'dry' : 'wet', );