http://www.perlmonks.org?node_id=962369


in reply to find index of specific array value that occurs multiple times

open(IN,">",$clu_align)
You are overwriting your input file!
Change > to <