in reply to determine a hash key

Hi
If it helps, you might want to consider a different data structure.
$hash{key1} = [1,2]; $hash{key2} = [1]; foreach (keys %hash){ $k = scalar @{$hash{$_}}; }

Artist