split takes a regular expression as its first argument, and not a string. What tripped you off was the double-interpolation that occurs when using string literals as regular expressions - just don't do that, use regular expressions instead:
split /\|/, $str;
In reply to Re: Surprised by split
by Corion
in thread Surprised by split
by GrandFather
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |