Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

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

by tchrist (Pilgrim)
on Oct 06, 2013 at 21:53 UTC ( [id://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?

Replies are listed 'Best First'.
Re^5: Where are the Perl::Critic Unicode policies for the Camel?
by vsespb (Chaplain) 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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1057197]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having an uproarious good time at the Monastery: (4)
As of 2024-04-19 22:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found