my %cod = ( 1 => "red", 2 => "non", 3 => "green", 4 => 'value for key 4' ); #### if ( exists $cod{$1} and $cod{$1} eq "non" ) { printf ...