The stupid question is the question not asked | |
PerlMonks |
Re: problem with split functionby tcf22 (Priest) |
on Oct 20, 2003 at 17:05 UTC ( [id://300664]=note: print w/replies, xml ) | Need Help?? |
Use quotemeta. This will escape all non-alphanumeric characters. The problem you are running into is the "|" is being interpreted as an "or" in the regex, so you split at "nothing" or "nothing", so it splits the string at every character(equivalent to split(//, $str).
Code Sample:
- Tom
In Section
Seekers of Perl Wisdom
|
|