updated the question with my code, pls check it now
In reply to Re^2: removing elements in array in perl by t-rex in thread removing elements in array in perl by t-rex