sub enquote { return { map { qq("$_") => 1 } @_ }; } my %attributes=( 'fo:font-style' => enquote( qw(normal italic oblique backslant inherit ) ), 'fo:fontvariant'=> enquote( qw(normal small-caps inherit ) ), 'fo:fontweight' => enquote( qw(normal bold bolder lighter inherit 100 200 300 400 500 600 700 800 900) ), 'fo:visibility' => enquote( qw(visible hidden collapse inherit) ), ); ##### for my $k (keys (%are)) { if ( $attributes{$k} and ! $attributes{$k}{$are{$k}} ) { print FOUT $errorMessage; } }