foreach my $lin (@lines) { substr($lin, 15, 0, "1" x 39); print "$lin\n"; }