Perl: the Markov chain saw | |
PerlMonks |
Re: CSV and regex mixupsby BrowserUk (Patriarch) |
on Jul 02, 2003 at 23:35 UTC ( [id://271009]=note: print w/replies, xml ) | Need Help?? |
If your trying to escape the embedded quotes before passing it to Text::CSV, then this might do the trick. Note: I've added some extra embedded quotes to check that it doesn't escaped already escaped quotes and handles the edge cases at either end of the string. You'll need to throw a few more tests at this before using it in anger.
This assumes that $s would otherwise be parsed correctly by Text::CSV. Examine what is said, not who speaks.
"Efficiency is intelligent laziness." -David Dunham"When I'm working on a problem, I never think about beauty. I think only how to solve the problem. But when I have finished, if the solution is not beautiful, I know it is wrong." -Richard Buckminster Fuller
In Section
Seekers of Perl Wisdom
|
|