use strict; use warnings; use utf8; use 5.008008; # minimum perl version ## v5.8.8 ~ required for decent basic Unicode support my @list = qw/ Foo bAR baZ /; if ( $] ge '5.016' ) { ## no critic ( ProhibitStringyEval RequireCheckingReturnValueOfEval ) eval q/@list = sort { ( CORE::fc $a ) cmp ( CORE::fc $b ) } @list;/ } else { @list = sort { ( lc $a ) cmp ( lc $b ) } @list; } print qq/[ @list ]/,"\n";