use Fcntl qw(:seek); open(my $fh, '+<', 'foo'); seek($fh, 3, SEEK_SET); print $fh '94'; close($fh);