in reply to How to make this substitutions without splitting the strings?

You don't need to split into an array to access positions in a string by index, you can use substr (or index to search for the indices of "-", or even a regex and pos). Also, you can output a new file with only the characters you want instead of manipulating a large string.

Show us some of your code and we can help you with that...

(I dimly remember seeing a similar question on PerlMonks recently... have you Googled your question?)

  • Comment on Re: How to make this substitutions without splitting the strings?

Replies are listed 'Best First'.
Re^2: How to make this substitutions without splitting the strings?
by BillKSmith (Monsignor) on Jul 28, 2014 at 12:24 UTC
    Remember to process the strings backwards so the 'erase' does not change the position of characters yet to be processed.
    Bill

      Note this only applies if you don't follow the parent's recommendation of generating new strings.