diff options
author | Karl Williamson <public@khwilliamson.com> | 2012-06-18 12:38:41 -0600 |
---|---|---|
committer | Karl Williamson <public@khwilliamson.com> | 2012-08-02 09:24:52 -0600 |
commit | 92feec867b2013acee7182eaa2b0f076a6e3aaec (patch) | |
tree | 7be7fbabb54520c564da2a1c682526cf4bf4f12d /lib | |
parent | 8e487a0f705bfe36e1ec39d159b211f75c8729e3 (diff) | |
download | perl-92feec867b2013acee7182eaa2b0f076a6e3aaec.tar.gz |
Unicode::UCD::prop_invlist() Allow to return internal property
This creates an optional undocumented parameter to this function to
allow it to return the inversion list of an internal-only Perl property.
This will be used by other functions in Perl, but should not be
documented, as we don't want to encourage the use of internal-only
properties, which are subject to change or removal without notice.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Unicode/UCD.pm | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lib/Unicode/UCD.pm b/lib/Unicode/UCD.pm index 81d729e593..a2557d8d5a 100644 --- a/lib/Unicode/UCD.pm +++ b/lib/Unicode/UCD.pm @@ -5,7 +5,7 @@ use warnings; no warnings 'surrogate'; # surrogates can be inputs to this use charnames (); -our $VERSION = '0.44'; +our $VERSION = '0.45'; require Exporter; @@ -2127,8 +2127,12 @@ properties, and will return C<undef> if called with one of those. our %loose_defaults; our $MAX_UNICODE_CODEPOINT; -sub prop_invlist ($) { +sub prop_invlist ($;$) { my $prop = $_[0]; + + # Undocumented way to get at Perl internal properties + my $internal_ok = defined $_[1] && $_[1] eq '_perl_core_internal_ok'; + return if ! defined $prop; require "utf8_heavy.pl"; @@ -2145,7 +2149,7 @@ sub prop_invlist ($) { || ref $swash eq "" || $swash->{'BITS'} != 1 || $swash->{'USER_DEFINED'} - || $prop =~ /^\s*_/; + || (! $internal_ok && $prop =~ /^\s*_/); if ($swash->{'EXTRAS'}) { carp __PACKAGE__, "::prop_invlist: swash returned for $prop unexpectedly has EXTRAS magic"; |