in reply to Re^2: Perl help
in thread Perl help

Then just adapt the SQLite code I gave you at: Re: join column 3 for unique values.
Read the whole previous thread carefully, there are many ideas in there that are applicable to this problem which is almost the same one.