in reply to how to read and write at the same time + a problem with seek
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);
|
|---|