#!/usr/bin/perl my $string = 'This is string'; my $capture1 = substr $string, 6, 2, "is stretched"; # This will substitute as expected my $capture2 = substr $string, 9, 6, 'STRING'; # Now here original string will be updated and positions I have already are of no use.