in reply to Perl help

This question is surprisingly similar to join column 3 for unique values by you as posted on Monday. Do the answers in that thread not provide the information you require?