in reply to Surprised by split

the problem is that you are quoting the string with double quotes and so, scaped chars are unscaped before the string is passed to split. Use // or '' instead:
split /\|/, 'foo|bar';