use if $] ge '5.016', feature => 'fc'; BEGIN { eval 'fc 1' or eval 'sub fc ($) { lc $_[0] }' }; ...; @list = sort { fc $a cmp fc $b } @list;