X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2Fcharnames.pm;h=934fafddd5ff8f5e0e95edaa6d3702d3376c51cd;hb=92dffb52e8549d6a194db47a2e5b989b8338a19a;hp=7c2209b9f0966cce8cd9500d3feaf5b0eee35630;hpb=17cab1b848e4960c008b73548ee8e62a9e9735ec;p=p5sagit%2Fp5-mst-13.2.git diff --git a/lib/charnames.pm b/lib/charnames.pm index 7c2209b..934fafd 100644 --- a/lib/charnames.pm +++ b/lib/charnames.pm @@ -1,5 +1,9 @@ package charnames; + +our $VERSION = '1.00'; + use bytes (); # for $bytes::hint_bits +use warnings(); $charnames::hint_bits = 0x20000; my $txt; @@ -51,6 +55,13 @@ sub import { $^H{charnames_full} = delete $h{':full'}; $^H{charnames_short} = delete $h{':short'}; $^H{charnames_scripts} = [map uc, keys %h]; + if (warnings::enabled('utf8') && @{$^H{charnames_scripts}}) { + $txt = do "unicode/Name.pl" unless $txt; + for (@{$^H{charnames_scripts}}) { + warnings::warn('utf8', "No such script: '$_'") unless + $txt =~ m/\t\t$_ (?:CAPITAL |SMALL )?LETTER /; + } + } }