http://qs1969.pair.com?node_id=1228945


in reply to Perl version dependent code

How about:

use if $] ge '5.016', feature => 'fc'; use if $] lt '5.016', 'Unicode::CaseFold' => 'fc';

See Unicode::CaseFold. Otherwise you could do:

*case_insens = $] ge '5.016' ? sub { &CORE::fc($a) cmp &CORE::fc($b) } : sub { lc $a cmp lc $b }; @list = sort {case_insens()} @list;

Update: Used &CORE::fc() instead of CORE::fc() so that it really does work on older Perls.