To further elaborate ... the first parameter to split() is always a regular expression (except the split ' ',... special case). Even if you enclose the parameter in quotes. So even split '+', $string emits that error message. IMHO, it's bad design, but that's the way it is. If you do want to split on a literal string and not have to worry about special characters you have to use split /\Q$separator\E/, $string.
HTH, Jenda
|
Support Denmark! Defend the free world! |
In reply to Re^2: split string on plus sign
by Jenda
in thread split string on plus sign
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |