diff options
author | Karl Williamson <khw@cpan.org> | 2014-07-19 11:35:34 -0600 |
---|---|---|
committer | Karl Williamson <khw@cpan.org> | 2015-01-21 22:47:28 -0700 |
commit | 088d3c625c5d08e639346a9310e125b2695315ac (patch) | |
tree | b5819719b4607f51fd3bd1b44c4ea49ece94aa0b /lib/Unicode | |
parent | b08d569eb38afbd16acdf263a6d8037825f66fb1 (diff) | |
download | perl-088d3c625c5d08e639346a9310e125b2695315ac.tar.gz |
Unicode::UCD: Allow internal properties in invmap()
This adds an undocumented way to get invmap() to return internal
properties, like invlist(). This is intended only for Perl-core
use.
Diffstat (limited to 'lib/Unicode')
-rw-r--r-- | lib/Unicode/UCD.pm | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/lib/Unicode/UCD.pm b/lib/Unicode/UCD.pm index 1eddc09e0d..f3d5541e92 100644 --- a/lib/Unicode/UCD.pm +++ b/lib/Unicode/UCD.pm @@ -2824,15 +2824,21 @@ our @algorithmic_named_code_points; our $HANGUL_BEGIN; our $HANGUL_COUNT; -sub prop_invmap ($) { +sub prop_invmap ($;$) { croak __PACKAGE__, "::prop_invmap: must be called in list context" unless wantarray; my $prop = $_[0]; return unless defined $prop; + # Undocumented way to get at Perl internal properties; it may be changed + # or removed without notice at any time. It currently also changes the + # output to use the format specified in the file rather than the one we + # normally compute and return + my $internal_ok = defined $_[1] && $_[1] eq '_perl_core_internal_ok'; + # Fail internal properties - return if $prop =~ /^_/; + return if $prop =~ /^_/ && ! $internal_ok; # The values returned by this function. my (@invlist, @invmap, $format, $missing); |