The module may be needed for more complex cases, but split can handle this one. Note use of negative look behind in the regular expression.
$_ = '1|str|foo\|bar|goo|2323'; $, = ','; print split /(?<!\\)\|/;
In reply to Re: Trouble splitting pipe delimited
by BillKSmith
in thread Trouble splitting pipe delimited
by kpiti
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |