in reply to help to write perl code

Please mark your updates , thank you. How do I change/delete my post?

Also , if I were you, I would adapt Re^2: HELP TO WRITE THE PERL CODE to take @id into account (like where the bit goes)