#I read with the script above my @terms and then add new words to it, eliminate duplicates, if any, and write it back. my @wordsfiltered = uniq_array(@terms); my $fh = openFileAndWrite($filename); foreach (@wordsfiltered){ print $fh $_ . "\n"; } close $fh;