Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re^2: Perl version dependent code (updated)

by Laurent_R (Canon)
on Jan 24, 2019 at 22:50 UTC ( [id://1228948]=note: print w/replies, xml ) Need Help??


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);

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1228948]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2024-04-25 05:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found