in reply to Re^4: Listing out the characters included in a character class [wide character warning]
in thread Listing out the characters included in a character class

Note that ordering is important:
#!/usr/bin/perl
use warnings;
use strict;
use utf8;

use Test::More tests => 1;
use open OUT => ':encoding(UTF-8)', ':std';

is "kůň", 1, 'same';
gives the warning, while
#!/usr/bin/perl
use warnings;
use strict;
use utf8;

use open OUT => ':encoding(UTF-8)', ':std';
use Test::More tests => 1;

is "kůň", 1, 'same';
does not.

That's why I recommended Test::More::UTF8. You can place it wherever you like and there are no warnings.

Update: <code> to <pre> to fix the non-English characters.

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]
  • Comment on Re^5: Listing out the characters included in a character class [wide character warning]
  • Select or Download Code

Replies are listed 'Best First'.
Re^6: Listing out the characters included in a character class [wide character warning]
by kcott (Archbishop) on Nov 03, 2023 at 10:22 UTC

    ++ Good to know. Thanks.

    Except when turning lexical pragmata on and off in limited scope, I always list pragmatic modules before non-pragmatic ones; so I never would have encountered that situation.

    — Ken

Re^6: Listing out the characters included in a character class [wide character warning]
by Polyglot (Chaplain) on Nov 04, 2023 at 12:03 UTC
    I didn't realize that with the "use" pragma it would matter the order. I have sometimes even ordered all of them at the top of the script by alphabetic order. I was aware that the "require" usage could be sensitive to order of appearance. Always more to learn, thank you. I wonder how many times in the past this may have bitten me, with me oblivious to the cause.

    Blessings,

    ~Polyglot~