Assert-Conditional
view release on metacpan or search on metacpan
lib/Assert/Conditional/Utils.pm view on Meta::CPAN
sub _get_comparitor($) {
my($level) = @_;
panic "invalid level $level" unless $level =~ /^[1-4]$/;
return $Comparitor[$level] if $Comparitor[$level];
require Unicode::Collate;
my $class = Unicode::Collate:: ;
# need to discount the other ones altogether
my @args = (level => $level); #, variable => "Non-Ignorable");
# if ($Opt{locale}) {
# require Unicode::Collate::Locale;
# $class = Unicode::Collate::Locale:: ;
# push @args, locale => $Opt{locale};
# }
my $coll = $class->new(@args);
$Comparitor[$level] = $coll;
}
for my $strength ( 1 .. 4 ) {
no strict "refs";
*{ "UCA$strength" } = sub(_) {
state $coll = _get_comparitor($strength);
return $coll->getSortKey($_[0]);
( run in 1.622 second using v1.01-cache-2.11-cpan-5a3173703d6 )