in reply to Surprised by split

My last attempt was: split "\\|", $str; which generated the result I was after.

This is known as the "lisp syntax" for regular expressions. The reason it's called that is because in lisp, there is no dedicated quoting mechanism for regular expressions, and so they have to be given in code as quoted strings. Any lisp manual will explain why the double-backslashing of everything is necessary.

Perl does provide dedicated quoting constructs for regular expressions, and your regular expressions will be much easier to read and maintain if you use them, rather than giving your regular expressions in lisp syntax using regular double-quoted strings.


"In adjectives, with the addition of inflectional endings, a changeable long vowel (Qamets or Tsere) in an open, propretonic syllable will reduce to Vocal Shewa. This type of change occurs when the open, pretonic syllable of the masculine singular adjective becomes propretonic with the addition of inflectional endings."  — Pratico & Van Pelt, BBHG, p68