in reply to Re^2: Perl version dependent code (updated)
in thread Perl version dependent code

my $c = "ж";

That's an HTML entity and consists of 7 separate characters. If you typed it like this then hopefully it becomes obvious why it doesn't match against "Ж" which is an entirely different string, folding notwithstanding.

OTOH, if you didn't type it like this but instead used a unicode literal string such as

my $c = "ж";
then your code is missing the absolutely necessary use utf8; pragma in order to decode this character properly.

(Edited for typo)

Replies are listed 'Best First'.
Re^4: Perl version dependent code (updated)
by Aldebaran (Curate) on Feb 05, 2019 at 09:05 UTC

    Indeed...

    $ ./1.version.pl 
    a is 5.026001
    b is v5.26.1
    version is v5
    version is v5.26.1
    c is ж
    d is Ж
    expressions matched
    $ cat 1.version.pl 
    #!/usr/bin/perl -w
    use 5.011;
    use Path::Tiny;
    use POSIX qw(strftime);
    use if $] ge '5.016', feature => 'fc';
    use if $] lt '5.016', 'Unicode::CaseFold' => 'fc';
    use utf8;
    use open OUT => ':encoding(UTF-8)', ':std';
    
    my $a = $];
    say "a is $a";
    
    my $b = $^V;
    say "b is $b";
    
    printf "version is v%d\n", $a;  # Perl's version
    printf "version is v%vd\n", $b;  # Perl's version
    
    my $c = "ж";
    say "c is $c";
    
    my $d = "Ж";
    say "d is $d";
    
    if (fc($c) eq fc($d)){
    say "expressions matched";
    
    } else {
        say "did not match";
    }
    __END__ 
    $