This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
utf8_heavy.pl: Make callable during Perl's compilation
authorKarl Williamson <public@khwilliamson.com>
Thu, 4 Nov 2010 21:02:17 +0000 (15:02 -0600)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 5 Nov 2010 23:11:42 +0000 (16:11 -0700)
commita44f4b74513a213052e4f78beb022f158efcf1a1
tree2f199cfc762a9b4f0e70cd5691836c84bf7329ed
parent68bb50b07e1a4db5feeb6f3d6d69e055a27e2aee
utf8_heavy.pl: Make callable during Perl's compilation

It's possible for this to be called during the compilation phase of Perl
by miniperl before the Unicode tables have been built.  This patch
checks if dynamic loading is available, and if not evals the require
needed to gain access to the tables.  If it succeeds, the tables have
been built; if it doesn't, instead of dying, just return empty tables,
as currently the things being built don't require information outside
the ASCII range, which is hard-coded into Perl without needing the
tables.

In the future, that may not be the case, and then likely the tables will
have to be shipped with Perl, and make regen would be done to rebuild
them.
lib/utf8_heavy.pl