petdance andy@petdance.comhttp://www.perlbuzz.com/AOL IM: petdance (
Add Buddy, Send Message)
Yahoo! ID: petdance (
Add User, Send Message)
Jabber: petdance@gmail.com
I'm Andy Lester, and I like to test stuff. I also write for the Perl Journal, and do tech edits on books. Sometimes I write code, too.
split() (Score:2)
My pet peeve is the opposite: people who use a string as the first argument to split(). Not only is it intended to be a regex, but some strings have special behaviour (" " for instance).
-Dom
'$' ne "\\z" (Score:2)
Re:'$' ne "\\z" (Score:2)
--
xoa
A regex question then? (Score:1)
Re:A regex question then? (Score:2)
--
xoa
Except sometimes. (Score:1)
When the string is in $_, I'll often use a regex for a string comparison so I can avoid spelling out the variable. This is particularly often the case when grep is involved.
It still annoys me though.
And abuse of regexen for string comparisons tends to crop up a lot in badly written scripts by people who don't really know Perl well (such as most of the stuff that circulates on “free CGI scripts!” sites.)
Not with unicode... (Score:1)
I think youll find that the equivelency you post doesnt hold for certain unicode characters like the greek sigma chars. Lowercase/Uppercase arent safe forms to do case insensitive comparisons in unicode instead they have a special form called "foldcased" which is intended for this purpose and involves prenormalizing the string.
Anyway, sorry this is with my pedant hat on.