Beefy Boxes and Bandwidth Generously Provided by pair Networks vroom
XP is just a number
 
PerlMonks  

Re^4: Where are the Perl::Critic Unicode policies for the Camel?

by tchrist (Pilgrim)
on Oct 06, 2013 at 21:53 UTC ( #1057197=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Where are the Perl::Critic Unicode policies for the Camel?
in thread Where are the Perl::Critic policies for the Camel?

Yes, you’re 100% right about all those things. Thanks for pointing them out, too.

My context was in the processing of text files, normally NLP type stuff but sometimes CSV files in this or that encoding.

I nevertheless think there are a lot of mistakes made, and that opening a textfile without specifying its encoding is a big problem.

I wonder what if anything can reasonably be done about that though.

--tom


Comment on Re^4: Where are the Perl::Critic Unicode policies for the Camel?
Re^5: Where are the Perl::Critic Unicode policies for the Camel?
by vsespb (Hermit) on Oct 06, 2013 at 22:52 UTC
    What about writing wrapper library over text file operations - thus you can enforce encoding specification, and even maybe prohobit foreach (<INPUT>) by providing own iterator function.
    Same probably can be done for some common text operations
    And probably some typical regexps, character constant can be moved out, some wrappers can be written over regexp (i.e. functions which create regexp at runtime)
    Cases when you care about "\X" vs "." are probably limited - spliting text, determining visible length, maybe something else - can be moved out to library too

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1057197]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (8)
As of 2014-04-20 18:35 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    April first is:







    Results (486 votes), past polls