open(READ, $filer) || die "error: couldnt open file: $!"; open(WRITE, "> $filew") || die "error: couldnt open file: $!"; while (defined ($line = )) { @words = split(/ /, $line); #here id like to compare word from each line of "input" with "cetnosti" and write it to "output" but i have no idea how to do it } close(READ); close(WRITE);