diff options
author | Father Chrysostomos <sprout@cpan.org> | 2010-11-05 23:51:06 -0700 |
---|---|---|
committer | Father Chrysostomos <sprout@cpan.org> | 2010-11-05 23:51:06 -0700 |
commit | 1363cbd099d4724e4aef1fe278b71abc057d23cc (patch) | |
tree | f7f0070bab61a0997b3bfd527dfdb48987530681 /lib | |
parent | b18bd085f437e451edf1cca6f3804fe5c9c4bf27 (diff) | |
download | perl-1363cbd099d4724e4aef1fe278b71abc057d23cc.tar.gz |
Avoid a run-time miniperl check every time SWASHNEW is called
Diffstat (limited to 'lib')
-rw-r--r-- | lib/utf8_heavy.pl | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/utf8_heavy.pl b/lib/utf8_heavy.pl index 56cfe059c2..7951bc8565 100644 --- a/lib/utf8_heavy.pl +++ b/lib/utf8_heavy.pl @@ -100,13 +100,19 @@ sub croak { require Carp; Carp::croak(@_) } # keep going, but return an empty table so only what the code # has compiled in internally (currently ASCII/Latin1 range # matching) will work. - if (! defined &DynaLoader::boot_DynaLoader) { + BEGIN { + # Poor man's constant, to avoid a run-time check. + $utf8::{miniperl} + = \! defined &DynaLoader::boot_DynaLoader; + } + if (miniperl) { eval "require '$unicore_dir/Heavy.pl'"; last GETFILE if $@; } else { require "$unicore_dir/Heavy.pl"; } + BEGIN { delete $utf8::{miniperl} } # Everything is caseless matching my $property_and_table = lc $type; |