encoding has problems, which is why I recommended use utf8;
| [reply] [d/l] |
use utf8;
$ENV{LANG} = 'ru_RU.UTF-8';
use open IO => ':locale'; # I tried ':utf8' instead but got warnings
| [reply] [d/l] [select] |
The bugs to which you linked are Encode's, not encoding. While they may effect use encoding, I was referring to use encoding's proper flaws. Now, I can't remember exactly what they were, but you can search the P5P mailing list for the conversation.
Depending on what you want to do,
# Use expected encoding for STDIN/OUT/ERR
use open ':std', ':locale';
# Use UTF-8 for STDIN/OUT/ERR
use open ':std', ':encoding(UTF-8)';
# Use UTF-8 for file IO
use open IO => ':encoding(UTF-8)';
:utf8 has a security vulnerability for input.
| [reply] [d/l] [select] |
Removing the "no warnings" would produce a warning. There's a '#' inside the 'qw//', and Perl gets a bit unhappy about those.
ben@Tyr:~$ perl -wle'print qw/#/'
Possible attempt to put comments in qw() list at -e line 1.
#
--
"Language shapes the way we think, and determines what we can think about."
-- B. L. Whorf
| [reply] [d/l] |
In fact there are no # characters in the code. They appear on OP post because of PM can not display unicode characters inside of <code> block.
The real code is:
@kmap = qw/A B V G D E + J Z I Y K L M N O P R S T U F H C X ! @ # $
% ^ & * a b v g d e = j z i y k l m n o p r s t u f h c x 1 2 3 4 5 6 7
8/;
@rmap = qw/А Б В Г Д Е Ё Ж З И Й К Л М Н О П Р С Т У Ф Х Ц Ч Ш Щ Ъ Ы Ь Э Ю Я а б в г д е ё ж з и й к л м н о п р с т у ф х ц ч ш щ ъ ы ь э ю я/;
}
| [reply] |
What's that between "@" and "$" in @kmap?
| [reply] |