in reply to Complicated search and replace on a string

Simply use Text::CSV_XS, which knows about quoted fields and handles them properly.

  • Comment on Re: Complicated search and replace on a string

Replies are listed 'Best First'.
Re^2: Complicated search and replace on a string
by Doozer (Scribe) on May 17, 2017 at 14:32 UTC
    Thanks! I never even thought to look for a csv parser (facepalm).

    That module does the trick and saves me a lot of work. It's clear now I was searching for the wrong thing.

      In the Perl environment, you should always look for a CPAN module first.   Q: “What is all the Perl-language fuss about?”   A: “CPAN!”

      Modules – thousands of them – to do just about anything imaginable.   All installed on your system, and self-tested on your system, in a matter of seconds.   It is almost never the right thing to do, to “roll your own.”   Leverage CPAN heavily.