in reply to update a txt file

Now the following works, and prints "read in 'xxx'". Given the file io.txt:

onetwothreefour
and the following code:
#! /usr/bin/perl -w use strict; if (open FILE, '+<io.txt') { seek FILE, 3, 0; print FILE 'xxx'; seek FILE, 3, 0; my $input = ''; sysread FILE, $input, 3; print "read in '$input'\n"; close FILE; }
But you really ought to have provided the misbehaving code.