3 ms·
$ perl -E'say "ω is " . "not "x("ω" !~ /\w/) . "a word"' ω is not a word $ perl -Mutf8 -E'say "ω is " . "not "x("ω" !~ /\w/) . "a word"' Wide character i
by d0mine 16y ago
$ perl -E'say "ω is " . "not "x("ω" !~ /\w/) . "a word"'
ω is not a word
$ perl -Mutf8 -E'say "ω is " . "not "x("ω" !~ /\w/) . "a word"'
Wide character in print at -e line 1.
ω is a word
- perlgeek 16y agoYou can get rid of the "wide character" warning with the -CS switch. As you demonstrate correctly, you need to tell Perl about the encoding of your script (and thus the literals in your script). `use utf8;` or at the command line `-Mutf8` does that.