for my $spot (reverse 11,25,31,35,39,44,49,66,71,76,78) { substr($_, $spot) =~ s/^\s*/,/; }