http://qs321.pair.com?node_id=553338


in reply to Matching and concatenating similar Eventids

If I understand your problem correctly, I recommend that you use a binding operator like so in case of a duplicate:
if (you-have-a-duplicate) { $data{$other_file} =~ s/^([^\|]*)\|/\1\/$other_file\|/; $data{$open_file} = "$open_file/$other_file|$status|$event_id|$msci +_sec_code"; }
This will add the filename to both the open file and the "other" file's entry.