in reply to how to read and write at the same time + a problem with seek

If I understand your question correctly perl -i might also do the trick (see perlrun for details, or type perldoc perlrun on your machine if www.perldoc.com is down):
perl -i -p -e ' BEGIN { print "what length?\n"; $sequenceLength = getc; } s/$/$sequenceLength/' seq.txt

will print the same question you asked for and add it to all lines in the file seq.txt.

Note that your getccall will only fetch 1 character, so if I answer '33' to the first question, it will only add a '3'. You might want to replace the getc part with something like:

$sequenceLength = <STDIN>; chomp($sequenceLength);