Reply to post: common::sense

Official: Perl the most hated programming language, say devs

Frumious Bandersnatch Silver badge

common::sense

First I've heard of it. I write a lot of code that uses utf8 and then has to binmode stderr and stdout to avoid "wide character" warnings when printing utf8 strings. It seems that common::sense solves the latter problem

$ perl -le 'use common::sense; my $a = { 私 => "あなた"}; print $a->{"私"};'

あなた

$ perl -le 'use utf8; my $a = { 私 => "あな た"}; print $a->{"私"};'

Wide character in print at -e line 1.

あなた

Now if only I didn't have to open files with 'open FILE, "<:encoding(UTF-8)", $fn' every time ...

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

Biting the hand that feeds IT © 1998–2019