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"; }