Help for this page
while (<$ifh>) { substr($_, $position, $width) =~ s/foo/bar/; print $ofh $_; # update $position and $width if necessary }