use English '-no_match_vars'; my %appearances_of; $appearances_of{$_}++ for map { split /\Q$SUBSCRIPT_SEPARATOR/ } keys %hash;