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