Perl: the Markov chain saw | |
PerlMonks |
Re: Splitting the record using the delimiterby KurtSchwind (Chaplain) |
on Sep 30, 2015 at 18:29 UTC ( [id://1143455]=note: print w/replies, xml ) | Need Help?? |
Above you told it to split on pipes. And what I get when I run it is "Hello\" which is split on pipes. Are you trying to split on pipes except when preceded by a backslash? If so:
Note: That since this now splits on a character followed by a pipe that $code[0] would be "H" and not "Hi". The short answer is you are looking for split to have a variable delimiter in this case. A pipe sometimes and no pipe at other times.
-- “For the Present is the point at which time touches eternity.” - CS Lewis
In Section
Seekers of Perl Wisdom
|
|