When I have a form with the <textarea> tag I enter some tekst in it, it works ok - the script writes the entered texts to a txt file but when I use another form with again the textarea tag it won't display the whole tekst only the part before the first enter.

That's because the input record delimeter (held in $/) is a newline by default.

Perl, by default, considers each line in a file a record. So to slurp the entire contents of the file into a scalar (that is, to define the record as the complete multiline file), you'll first need to clear the default record delimeter.