in reply to Re^2: Where are the Perl::Critic Unicode policies for the Camel?
in thread Where are the Perl::Critic policies for the Camel?
lc($a) cmp/eq/ne/... lc($b) should be using fc. Same story with uc.
Something like a-z should often be \p{Ll} or \p{lower}If you write, say, code which have to deal with parsing http headers (no, that's not reinvention of wheel, like HTTP library, that can be a proxy server or REST library), then "cmp" and "a-z" would be correct choice, and fc() \p{lower} can introduce bugs (say, with "β" vs "ss").
Opening a text file without stating its encoding somewhere or other is a recipe for failure.Unless it's a binary file.
@lines = do { local $/; split /\R/, <INPUT> };Hm. I think it's not correct to use something like U+2028 as line separator for files.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: Where are the Perl::Critic Unicode policies for the Camel?
by tchrist (Pilgrim) on Oct 06, 2013 at 21:53 UTC | |
by vsespb (Chaplain) on Oct 06, 2013 at 22:52 UTC |