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

Great idea and nice implementation, but I wonder whether it wouldn't be simpler at this point to use the case_fold function of Unicode::CaseFold in both cases, i.e. irrespective of the Perl version. Something like this (not able to test right now):
use Unicode::CaseFold qw(case_fold !fc) @list = sort {case_fold($_)} @list;
(I know this no longer answers the OP exact question, but it seems to me this would be more straight forward.)

Replies are listed 'Best First'.
Re^3: Perl version dependent code
by haukex (Archbishop) on Jan 25, 2019 at 11:38 UTC
    simpler at this point to use the case_fold function of Unicode::CaseFold in both cases

    Sure, TIMTOWTDI :-) Personally I just prefer core Perl when reasonably possible.

    Here's another variant (Unicode::Collate has been in the core since 5.8), although the sorting order is different:

    use Unicode::Collate; @list = Unicode::Collate->new()->sort(@list);