Talk:Leaning toothpick syndrome
From Wikipedia, the free encyclopedia
I am not really a computer programmer so I can't tell what that pear script is supposed to say. Can an expert include what the code outputs as so it is obvious the problems with Leaning toothpick syndrome. Ed Dehm 04:46, 2 November 2006 (UTC)
- Perl, not pear. ;) Anyway, it is "supposed" to say any of the 4 examples given. Alone they are not valid lines of perl, they are just an example of a regular expression (regex). The normal character used to delimit a regex in perl is / so if I was looking for "abcd" the expression would be m/abcd/ but if I wanted to look for "a/b/c/d" the regex would be m/a\/b\/c\/d/ because a \ is needed as an escape character to tell perl that the / it is about to see isn't the end of search; that begins to look like a bunch of leaning toothpicks. So perl lets you use other characters to delimit the search, as shown in the last three examples. My example would become m{a/b/c/d} which is not only prettier but much easier for another programmer to see what I am up to. — RevRagnarok Talk Contrib 12:11, 2 November 2006 (UTC)