in reply to Counting Hash values?

Ignore the input keys, split each value on its first "|", collect all unique preceding numbers hashed by following string.
foreach (values %in) { /(.*?)\|(.*)/; $out{$2}{$1} = 1; }
Convert %out values from hash ref to array of keys
foreach (values %out) { $_ = [sort keys %$_]; } # $out{"RED DOOR|10-14"}[0] = 73 etc
I'm assuming there may be repeated values in the input but you only want each number once per key in the output.