15 20 25 #### use Fcntl qw(:seek); open(my $fh, '+<', 'foo'); seek($fh, 3, SEEK_SET); print $fh '94'; close($fh); #### $foo = "ab cd ef"; substr($foo, 3, 2) = "cat"; say $foo;