more useful options | |
PerlMonks |
Trouble splitting pipe delimitedby kpiti (Novice) |
on Nov 05, 2012 at 00:34 UTC ( [id://1002256]=perlquestion: print w/replies, xml ) | Need Help?? |
kpiti has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I need to split | delimeted line but with escaping potential \| strings. I'm playing with Text::Balanced but I'm not getting the right results.
Say I have a line like 1|str|foo\|bar|goo|2323 I need it to be split into the following fields: 1,str,foo\|bar,goo,2323 The code: will return which is way wrong. And plain split will split on \| as well as plain |.. Any hints on the right (or smart, or both :) way to do this?
Back to
Seekers of Perl Wisdom
|
|