lib/Locale/Unicode.pm

filter: Statementstmt 67.1% 584 / 870 Branchbran 48.0% 196 / 408 Conditioncond 32.4% 133 / 410 MC/DCmcdc 11.3% 24 / 211 Subroutinesub 61.7% 131 / 212 Podpod 95.2% 119 / 125 totaltotal 53.0% 1187 / 2236 CC 365 SCAR 49.5
CC
365
Cov
54%
pass_error
1310.5
parse
332.5
_set_get_prop
133.0
CRAP 140.7
↑ Summary
1 ##----------------------------------------------------------------------------
2 ## Unicode Locale Identifier - ~/lib/Locale/Unicode.pm
3 ## Version v0.4.6
4 ## Copyright(c) 2026 DEGUEST Pte. Ltd.
5 ## Author: Jacques Deguest <jack@deguest.jp>
6 ## Created 2024/05/11
7 ## Modified 2026/10/23
8 ## All rights reserved
9 ##
10 ## This program is free software; you can redistribute it and/or modify it
11 ## under the same terms as Perl itself.
12 ##----------------------------------------------------------------------------
13 package Locale::Unicode;
14 BEGIN
15 3 ▶{
Subroutine BEGIN: called CC=1 SCAR=0.0
16 3 ▶ use v5.10.1;
Subroutine BEGIN: called CC=1 SCAR=0.0
17 3 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
18 3 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
19 3 ▶ use warnings::register;
Subroutine BEGIN: called CC=1 SCAR=0.0
20 3 ▶ use vars qw(
Subroutine BEGIN: called CC=1 SCAR=0.0
21 $ERROR $VERSION $DEBUG $FATAL_EXCEPTIONS
22 $LOCALE_BCP47_RE $LOCALE_BCP47_NAMELESS_RE $LOCALE_RE $LOCALE_UNICODE_SUBTAG_RE
23 $LOCALE_EXTENSIONS_RE $LOCALE_TRANSFORM_PARAMETERS_RE $GRANDFATHERED_IRREGULAR
24 $GRANDFATHERED_REGULAR
25 $TZ_DICT $TZ_NAME2ID
26 $PROP_TO_SUB
27 $EXPLICIT_BOOLEAN
28 3 );
29 3 ▶ use overload (
Subroutine BEGIN: called CC=1 SCAR=0.0
30 '""' => 'as_string',
31 117 ▶ bool => sub{1},
Subroutine __ANON__: called CC=1 SCAR=0.0
32 3 fallback => 1,
33 3 );
34 3 ▶ use Scalar::Util ();
Subroutine BEGIN: called CC=1 SCAR=0.0
35 3 ▶ use Wanted;
Subroutine BEGIN: called CC=1 SCAR=0.0
36 # ""root" is treated as a special unicode_language_subtag"
37 # <https://unicode.org/reports/tr35/tr35.html#Unicode_language_identifier>
38 # NOTE: $LOCALE_BCP47_RE
39 3 our $LOCALE_BCP47_RE = qr/
40 (?:
41 (?:
42 # "root" is treated as a special Unicode language subtag in the LDML and required in the valid pattern
43 (?<root>root)
44 |
45 (?<language>[a-z]{2})
46 |
47 (?<language3>[a-z]{3})
48 )
49 # "Up to three optional extended language subtags composed of three letters each, separated by hyphens"
50 # "There is currently no extended language subtag registered in the Language Subtag Registry without an equivalent and preferred primary language subtag"
51 (?:
52 \-
53 (?<extended>
54 [a-z]{3}
55 (?:\-[a-z]{3}){0,2}
56 )
57 )?
58 )
59 # ISO 15924 for scripts
60 (?:
61 -
62 (?:
63 (?<script>[A-Z][a-z]{3})
64 |
65 (?<script>[a-z]{4})
66 )
67 )?
68 (?:
69 (?:
70 -
71 (?<territory>
72 (?<country_code>[A-Z]{2})
73 |
74 # BCP47, section 2.2.4.4: the UN Standard Country or Area Codes for Statistical Use
75 # We are careful not to catch a following variant starting with a digit.
76 (?<region>\d{3}(?!\d))
77 )
78 )?
79 # "Optional variant subtags, separated by hyphens, each composed of five to eight letters, or of four characters starting with a digit"
80 # ca-ES-valencia
81 # country code can be skipped if the variant is limited to a country
82 # be-tarask
83 (?:
84 -
85 (?<variant>
86 (?:
87 (?:[[:alnum:]]{5,8})
88 |
89 (?:\d[[:alnum:]]{3})
90 )
91 (?:
92 \-
93 (?:
94 (?:[[:alnum:]]{5,8})
95 |
96 (?:\d[[:alnum:]]{3})
97 )
98 )*
99 )
100 )?
101 )?
102 /xi;
103 # We need the same regular express as $LOCALE_BCP47_RE, but without named capturing group
104 # so it does not interfere with matches from $LOCALE_BCP47_RE
105 # NOTE: $LOCALE_BCP47_NAMELESS_RE
106 3 our $LOCALE_BCP47_NAMELESS_RE = qr/
107 (?:
108 (?:
109 # "root" is treated as a special Unicode language subtag in the LDML and required in the valid pattern
110 (?:root)
111 |
112 (?:[a-z]{2})
113 |
114 (?:[a-z]{3})
115 )
116 # "Up to three optional extended language subtags composed of three letters each, separated by hyphens"
117 # "There is currently no extended language subtag registered in the Language Subtag Registry without an equivalent and preferred primary language subtag"
118 (?:
119 \-
120 (?:
121 [a-z]{3}
122 (?:\-[a-z]{3}){0,2}
123 )
124 )?
125 )
126 # ISO 15924 for scripts
127 (?:
128 -
129 (?:
130 (?:[A-Z][a-z]{3})
131 |
132 (?:[a-z]{4})
133 )
134 )?
135 (?:
136 (?:
137 -
138 (?:
139 (?:[A-Z]{2})
140 |
141 # BCP47, section 2.2.4.4: the UN Standard Country or Area Codes for Statistical Use
142 # We are careful not to catch a following variant starting with a digit.
143 (?:\d{3}(?!\d))
144 )
145 )?
146 # "Optional variant subtags, separated by hyphens, each composed of five to eight letters, or of four characters starting with a digit"
147 # ca-ES-valencia
148 # country code can be skipped if the variant is limited to a country
149 # be-tarask
150 (?:
151 -
152 (?:
153 (?:
154 (?:[[:alnum:]]{5,8})
155 |
156 (?:\d[[:alnum:]]{3})
157 )
158 (?:
159 \-
160 (?:
161 (?:[[:alnum:]]{5,8})
162 |
163 (?:\d[[:alnum:]]{3})
164 )
165 )*
166 )
167 )?
168 )?
169 /xi;
170 # NOTE: $LOCALE_UNICODE_SUBTAG_RE
171 3 our $LOCALE_UNICODE_SUBTAG_RE = qr/
172 (?<ext_unicode_subtag>
173 (?:
174 (?<ext_calendar>ca)
175 |
176 (?<ext_currency_format>cf)
177 |
178 (?<ext_collation>co)
179 |
180 (?<ext_currency>cu)
181 |
182 (?<ext_dict_break_exclusion>dx)
183 |
184 (?<ext_emoji>em)
185 |
186 (?<ext_first_day>fw)
187 |
188 (?<ext_hour_cycle>hc)
189 |
190 (?<ext_line_break>lb)
191 |
192 (?<ext_line_break_word>lw)
193 |
194 (?<ext_measurement>ms)
195 |
196 (?<ext_unit>mu)
197 |
198 (?<ext_number>nu)
199 |
200 (?<ext_region_override>rg)
201 |
202 (?<ext_subdivision>sd)
203 |
204 (?<ext_sentence_break_suppression>ss)
205 |
206 (?<ext_time_zone>tz)
207 |
208 (?<ext_variant>va)
209 |
210 (?<ext_unicode_unknown>
211 [a-zA-Z0-9]{2,8}
212 )
213 )
214 (?<ext_unicode_values>
215 (?:\-
216 # Collation or Transformation subtags, eventhough the latter should not be here
217 (?!(?:ka|kb|kc|kf|kh|kk|kn|kr|ks|kv|vt|d0|h0|i0|k0|m0|s0|t0|x0|[a]0)[^[:alnum:]])
218 [a-zA-Z0-9]{2,8}
219 )*
220 )
221 )
222 (?:
223 \-
224 (?:
225 # Should not be here, but could be malformed
226 (?<transform_options>
227 (?:d0|h0|i0|k0|m0|s0|t0|x0|[a]0)
228 (?:\-[a-zA-Z0-9]{2,8})*
229 )
230 |
231 (?<collation_options>
232 (?:ka|kb|kc|kf|kh|kk|kn|kr|ks|kv|vt)
233 (?:\-[a-zA-Z0-9]{2,8})*
234 )
235 )
236 )?
237 /xi;
238 # NOTE: $LOCALE_TRANSFORM_PARAMETERS_RE
239 3 our $LOCALE_TRANSFORM_PARAMETERS_RE = qr/(?:d0|h0|i0|k0|m0|s0|t0|x0|[a]0)/i;
240 # NOTE: $LOCALE_TRANSFORM_SUBTAG_RE
241 3 our $LOCALE_TRANSFORM_SUBTAG_RE = qr/
242 (?<ext_transform_locale>
243 $LOCALE_BCP47_NAMELESS_RE
244 )
245 (?:
246 \-
247 (?<ext_transform_subtag>
248 (?:
249 (?<ext_destination>d0)
250 |
251 (?<ext_hybrid>h0)
252 |
253 (?<ext_input>i0)
254 |
255 (?<ext_keyboard>k0)
256 |
257 (?<ext_mechanism>m0)
258 |
259 (?<ext_source>s0)
260 |
261 (?<ext_translation>t0)
262 |
263 (?<ext_private_transform>x0)
264 |
265 (?<ext_transform_unknown>
266 [a-zA-Z0-9]{2,8}
267 )
268 )
269 (?<ext_transform_values>
270 (?:\-
271 # Transformation or Unicode collation subtags, eventhough the latter should not be here
272 (?!(?:ka|kb|kc|kf|kh|kk|kn|kr|ks|kv|vt|d0|h0|i0|k0|m0|s0|t0|x0|[a]0)[^[:alnum:]])
273 [a-zA-Z0-9]{2,8}
274 )*
275 )
276 )
277 )?
278 (?:
279 \-
280 (?:
281 (?<transform_options>
282 (?:d0|h0|i0|k0|m0|s0|t0|x0|[a]0)
283 (?:\-[a-zA-Z0-9]{2,8})*
284 )
285 |
286 # Should not be here, but could be malformed
287 (?<collation_options>
288 (?:ka|kb|kc|kf|kh|kk|kn|kr|ks|kv|vt)
289 (?:\-[a-zA-Z0-9]{2,8})*
290 )
291 )
292 )?
293 /xi;
294 # NOTE: $LOCALE_EXTENSIONS_RE
295 3 our $LOCALE_EXTENSIONS_RE = qr/
296 (?:
297 (?<ext_transform>
298 t
299 \-
300 $LOCALE_TRANSFORM_SUBTAG_RE
301 )
302 |
303 (?<ext_unicode>
304 u
305 \-
306 $LOCALE_UNICODE_SUBTAG_RE
307 )
308 |
309 (?<extension>
310 (?<singleton>[a-wy-z])
311 \-
312 (?<subtag>
313 [a-zA-Z0-9]{2,8}
314 (?:\-[a-zA-Z0-9]{2,8})*
315 )
316 )
317 )
318 /xi;
319 # NOTE: $GRANDFATHERED_IRREGULAR
320 3 our $GRANDFATHERED_IRREGULAR = qr/
321 (?:
322 en-GB-oed
323 |
324 (?:i-
325 (?:ami|bnn|default|enochian|hak|klingon|lux|mingo|navajo|pwn|tao|tay|tsu)
326 )
327 |
328 (?:sgn-(?:BE-FR|BE-NL|CH-DE))
329 )
330 /xi;
331 # NOTE: $GRANDFATHERED_REGULAR
332 3 our $GRANDFATHERED_REGULAR = qr/
333 (?:
334 art-lojban|cel-gaulish|no-bok|no-nyn|zh-guoyu|zh-hakka|zh-min|zh-min-nan|zh-xiang
335 )
336 /xi;
337 # Possible IETF BCP 47 language tags:
338 # fr
339 # fre
340 # fr-Bret
341 # fr-FR
342 # fr-Bret-FR
343 # See: <https://en.wikipedia.org/wiki/IETF_language_tag#Syntax_of_language_tags>
344 # <https://en.wikipedia.org/wiki/ISO_15924>
345 # Grandfathered subtags: <https://www.rfc-editor.org/rfc/rfc5646.html#section-2.2.8>
346 # NOTE: $LOCALE_RE
347 3 our $LOCALE_RE = qr/
348 (?<locale_bcp47>
349 (?:
350 (?:
351 x
352 \-
353 (?<privateuse>
354 [a-zA-Z0-9]{1,8}
355 (?:\-[a-zA-Z0-9]{1,8})*
356 )
357 )
358 |
359 (?<grandfathered>
360 (?<grandfathered_irregular>$GRANDFATHERED_IRREGULAR)
361 |
362 (?<grandfathered_regular>$GRANDFATHERED_REGULAR)
363 )
364 |
365 $LOCALE_BCP47_RE
366 )
367 )
368 # BCP47, section 2.2.6:
369 # "Optional extension subtags, separated by hyphens, each composed of a single character, with the exception of the letter x, and a hyphen followed by one or more subtags of two to eight characters each, separated by hyphens"
370 (?:
371 \-
372 (?:
373 (?:
374 (?<locale_extensions>
375 $LOCALE_EXTENSIONS_RE
376 (?:
377 \-
378 $LOCALE_EXTENSIONS_RE
379 )*
380 )?
381 # "An optional private-use subtag, composed of the letter x and a hyphen followed by subtags of one to eight characters each, separated by hyphens"
382 (?:
383 \-
384 (?<private_extension>
385 x
386 \-
387 (?<private_subtag>
388 [a-zA-Z0-9]{1,8}
389 (?:\-[a-zA-Z0-9]{1,8})*
390 )
391 )
392 )*
393 )
394 |
395 (?<private_extension>
396 x
397 \-
398 (?<private_subtag>
399 [a-zA-Z0-9]{1,8}
400 (?:\-[a-zA-Z0-9]{1,8})*
401 )
402 )
403 )
404 )?
405 /xi;
406 3 our $PROP_TO_SUB = {};
407 # False, by default
408 3 our $EXPLICIT_BOOLEAN = 0;
409 3 our $VERSION = 'v0.4.6';
410 };
411  
412 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
413 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
414  
415 sub new
416 89 ▶{
Subroutine new: called CC=21 SCAR=33.4
Pod documented
417 89 my $this = shift( @_ );
418 89 ▶ my $self = bless( {} => ( ref( $this ) || $this ) );
Condition66%2/3
ref $this || $this
l!l&&r!l&&!r
11780
MC/DC0%0/2
ref $this || $this
ref $this $this
Truth table66%2/3
A || B
A= ref $thisB= $this
ABresult
1X1
011
000
419 89 ▶ my $locale = shift( @_ ) ||
Condition50%1/2
shift @_ || (return $self->error('No locale was provided.'))
l!l
890
MC/DC0%0/1
shift @_ || (return $self->error('No locale was provided.'))
shift @_
Truth table50%1/2
A
A= shift @_
Aresult
11
00
420 return( $self->error( "No locale was provided." ) );
421 # u-dx
422 89 $self->{break_exclusion} = undef;
423 # u-ca
424 89 $self->{calendar} = undef;
425 # u-co
426 89 $self->{collation} = undef;
427 # ISO3166 2-letters country code
428 89 $self->{country_code} = undef;
429 # u-cf
430 89 $self->{cu_format} = undef;
431 # u-cu
432 89 $self->{currency} = undef;
433 # t-d0
434 89 $self->{destination} = undef;
435 # u-em
436 89 $self->{emoji} = undef;
437 89 $self->{extended} = undef;
438 89 ▶ $self->{fatal} = ( $FATAL_EXCEPTIONS // 0 );
Condition50%1/2
$Locale::Unicode::FATAL_EXCEPTIONS // 0
l!l
089
MC/DC0%0/1
$Locale::Unicode::FATAL_EXCEPTIONS // 0
$Locale::Unicode::FATAL_EXCEPTIONS
Truth table50%1/2
A
A= $Locale::Unicode::FATAL_EXCEPTIONS
Aresult
11
00
439 # u-fw
440 89 $self->{first_day} = undef;
441 89 $self->{grandfathered_irregular} = undef;
442 89 $self->{grandfathered_regular} = undef;
443 # u-hc
444 89 $self->{hour_cycle} = undef;
445 # t-h0
446 89 $self->{hybrid} = undef;
447 # t-i0
448 89 $self->{input} = undef;
449 89 $self->{language} = undef;
450 89 $self->{language3} = undef;
451 # u-lb
452 89 $self->{line_break} = undef;
453 # u-lw
454 89 $self->{line_break_word} = undef;
455 # u-ms
456 89 $self->{measurement} = undef;
457 # u-nu
458 89 $self->{number} = undef;
459 # Overlong country code (3-characters code) whereas it should be 2-characters code
460 # For example: PAN -> PA
461 # See the 'alias' method in Locale::Unicode::Data to convert those overlong territory to their 2-characters equivalent
462 89 $self->{overlong} = undef;
463 # u-mu
464 89 $self->{unit} = undef;
465 # t-m0
466 89 $self->{mechanism} = undef;
467 # x-something
468 89 $self->{private} = undef;
469 89 $self->{privateuse} = undef;
470 89 $self->{region} = undef;
471 # u-rg
472 89 $self->{region_override} = undef;
473 # t-s0
474 89 $self->{source} = undef;
475 89 $self->{script} = undef;
476 89 $self->{territory} = undef;
477 # t-t0
478 89 $self->{translation} = undef;
479 # u-sd
480 89 $self->{subdivision} = undef;
481 # t-x
482 89 $self->{t_private} = undef;
483 # u-tz
484 89 $self->{time_zone} = undef;
485 # u-va
486 89 $self->{variant} = undef;
487 # A simple dictionary that stores the preferred boolean representation for each attribute
488 # i.e. yes or true, no or false
489 # literal or logic
490 89 $self->{_bool_types} = {};
491 89 my @args = @_;
492 89 ▶ if( scalar( @args ) == 1 &&
Branch: 2 branches
BranchTrueFalseTotal
if (scalar @args == 1 and defined $args[0] and ref $args[0] eq 'HASH') { } 0 89 89
elsif (scalar(@args) % 2) { } 0 89 89
Condition33%2/6
scalar @args == 1 and defined $args[0] and ref $args[0] eq "HASH"
!ll&&!rl&&r
8900
scalar @args == 1 and defined $args[0]
!ll&&!rl&&r
8900
MC/DC0%0/3
scalar @args == 1 and defined $args[0] and ref $args[0] eq "HASH"
scalar @args == 1 defined $args[0] ref $args[0] eq "HASH"
Truth table25%1/4
A and B and C
A= scalar @args == 1B= defined $args[0]C= ref $args[0] eq "HASH"
ABCresult
0XX0
10X0
1100
1111
493 defined( $args[0] ) &&
494 ref( $args[0] ) eq 'HASH' )
495 {
496 0 my $opts = shift( @args );
497 # We need to set up early, so we can use it soon after
498 0 ▶ $self->{fatal} = delete( $opts->{fatal} ) if( exists( $opts->{fatal} ) );
Branch: 1 branch
BranchTrueFalseTotal
if exists $opts->{"fatal"} 0 0 0
499 0 @args = %$opts;
500 }
501 elsif( ( scalar( @args ) % 2 ) )
502 {
503 0 return( $self->error( sprintf( "Uneven number of parameters provided (%d). Should receive key => value pairs. Parameters provided are: %s", scalar( @args ), join( ', ', @args ) ) ) );
504 }
505  
506 89 ▶ for( my $i = 0; $i < scalar( @args ); $i += 2 )
Branch: 1 branch
BranchTrueFalseTotal
if ($i < scalar @args) 2 88 90
507 {
508 2 ▶ if( $args[$i] eq 'fatal' )
Branch: 1 branch
BranchTrueFalseTotal
if ($args[$i] eq "fatal") 1 1 2
509 {
510 1 $self->{fatal} = $args[$i + 1];
511 1 last;
512 }
513 }
514  
515 # If the locale provided contains any subtags, parse it
516 89 ▶ if( index( $locale, '-' ) != -1 ||
Branch: 1 branch
BranchTrueFalseTotal
if (index($locale, "-") != -1 or index($locale, "_") != -1) 73 16 89
Condition66%2/3
index($locale, "-") != -1 or index($locale, "_") != -1
l!l&&r!l&&!r
73016
MC/DC50%1/2
index($locale, "-") != -1 or index($locale, "_") != -1
index($locale, "-") != -1 index($locale, "_") != -1
Truth table66%2/3
A or B
A= index($locale, "-") != -1B= index($locale, "_") != -1
ABresult
1X1
011
000
517 index( $locale, '_' ) != -1 )
518 {
519 73 $locale =~ tr/_/-/;
520 }
521 89 ▶ my $ref = $self->parse( $locale ) ||
Condition50%1/2
$self->parse($locale) || (return $self->pass_error)
l!l
890
MC/DC0%0/1
$self->parse($locale) || (return $self->pass_error)
$self->parse($locale)
Truth table50%1/2
A
A= $self->parse($locale)
Aresult
11
00
522 return( $self->pass_error );
523 89 ▶ return( $self->error( "Invalid locale value \"${locale}\" provided." ) ) if( !scalar( keys( %$ref ) ) );
Branch: 1 branch
BranchTrueFalseTotal
unless scalar keys %$ref 1 88 89
524 88 ▶ $self->apply( $ref ) || return( $self->pass_error );
Branch: 1 branch
BranchTrueFalseTotal
$self->apply($ref) or return $self->pass_error 88 0 88
525  
526 # Then, if the user provided with an hash or hash reference of options, we apply them
527 88 ▶ for( my $i = 0; $i < scalar( @args ); $i++ )
Branch: 1 branch
BranchTrueFalseTotal
if ($i < scalar @args) 1 88 89
528 {
529 1 my $name = $args[ $i ];
530 1 my $val = $args[ ++$i ];
531 1 my $meth = $self->can( $name );
532 1 ▶ if( !defined( $meth ) )
Branch: 2 branches
BranchTrueFalseTotal
if (not defined $meth) { } 0 1 1
elsif (not defined &$meth($self, $val)) { } 0 1 1
533 {
534 0 return( $self->error( "Unknown method \"${meth}\" provided for locale \"${locale}\"." ) );
535 }
536 elsif( !defined( $meth->( $self, $val ) ) )
537 {
538 0 ▶ if( defined( $val ) && $self->error )
Branch: 1 branch
BranchTrueFalseTotal
if (defined $val and $self->error) 0 0 0
Condition0%0/3
defined $val and $self->error
!ll&&!rl&&r
000
MC/DC0%0/2
defined $val and $self->error
defined $val $self->error
Truth table0%0/3
A and B
A= defined $valB= $self->error
ABresult
0X0
100
111
539 {
540 0 return( $self->pass_error );
541 }
542 }
543 }
544 88 return( $self );
545 }
546  
547 sub apply
548 88 ▶{
Subroutine apply: called CC=9 SCAR=24.1
Pod documented
549 88 my $self = shift( @_ );
550 88 my $hash = $self->_get_args_as_hash( @_ );
551 88 ▶ return( $self ) if( !scalar( keys( %$hash ) ) );
Branch: 1 branch
BranchTrueFalseTotal
unless scalar keys %$hash 0 88 88
552 88 foreach my $prop ( keys( %$hash ) )
553 {
554 186 ▶ next if( $prop eq 'transform_ext' || $prop eq 'unicode_ext' );
Branch: 1 branch
BranchTrueFalseTotal
if $prop eq "transform_ext" or $prop eq "unicode_ext" 14 172 186
Condition100%3/3
$prop eq "transform_ext" or $prop eq "unicode_ext"
l!l&&r!l&&!r
95172
MC/DC100%2/2
$prop eq "transform_ext" or $prop eq "unicode_ext"
$prop eq "transform_ext" $prop eq "unicode_ext"
Truth table100%3/3
A or B
A= $prop eq "transform_ext"B= $prop eq "unicode_ext"
ABresult
1X1
011
000
555 172 my $code;
556 172 ▶ unless( $code = $PROP_TO_SUB->{ $prop } )
Branch: 1 branch
BranchTrueFalseTotal
unless ($code = $Locale::Unicode::PROP_TO_SUB->{$prop}) 12 160 172
557 {
558 12 $code = $self->can( $prop );
559 12 ▶ if( !$code )
Branch: 1 branch
BranchTrueFalseTotal
unless ($code) 0 12 12
560 {
561 0 ▶ warn( "No method \"${prop}\" supported in ", ( ref( $self ) || $self ) ) if( warnings::enabled() );
Branch: 1 branch
BranchTrueFalseTotal
if warnings::enabled() 0 0 0
Condition0%0/3
ref $self || $self
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $self || $self
ref $self $self
Truth table0%0/3
A || B
A= ref $selfB= $self
ABresult
1X1
011
000
562 0 next;
563 }
564 12 $PROP_TO_SUB->{ $prop } = $code;
565 }
566 172 $code->( $self, $hash->{ $prop } );
567 }
568 88 return( $self );
569 }
570  
571 sub as_string
572 83 ▶{
Subroutine as_string: called CC=24 SCAR=34.7
Pod documented
573 83 my $self = shift( @_ );
574 83 ▶ return( $self->{_cache_value} ) if( $self->{_cache_value} && !CORE::length( $self->{_reset} // '' ) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"_cache_value"} and not length($self->{"_reset"} // "") 35 48 83
Condition60%3/5
$self->{"_cache_value"} and not length($self->{"_reset"} // "")
!ll&&!rl&&r
48035
$self->{"_reset"} // ""
l!l
035
MC/DC50%1/2
$self->{"_cache_value"} and not length($self->{"_reset"} // "")
$self->{"_cache_value"} $self->{"_reset"}
Truth table66%2/3
A and not(B)
A= $self->{"_cache_value"}B= $self->{"_reset"}
ABresult
0X0
110
101
575 48 my $unicodes =
576 {
577 ca => 'calendar',
578 cf => 'cu_format',
579 co => 'collation',
580 cu => 'currency',
581 dx => 'break_exclusion',
582 em => 'emoji',
583 fw => 'first_day',
584 hc => 'hour_cycle',
585 lb => 'line_break',
586 lw => 'line_break_word',
587 ms => 'measurement',
588 mu => 'unit',
589 nu => 'number',
590 rg => 'region_override',
591 sd => 'subdivision',
592 ss => 'sentence_break',
593 tz => 'time_zone',
594 va => 'va',
595 };
596 48 my $collation =
597 {
598 ka => 'colAlternate',
599 kb => { type => 'boolean', method => 'colBackwards' },
600 kc => { type => 'boolean', method => 'colCaseLevel' },
601 kf => 'colCaseFirst',
602 kh => { type => 'boolean', method => 'colHiraganaQuaternary' },
603 kk => { type => 'boolean', method => 'colNormalization' },
604 kn => { type => 'boolean', method => 'colNumeric' },
605 kr => 'colReorder',
606 ks => 'colStrength',
607 kv => 'colValue',
608 vt => 'colVariableTop',
609 };
610 48 my $transform =
611 {
612 d0 => 'destination',
613 h0 => 'hybrid',
614 i0 => 'input',
615 k0 => 'keyboard',
616 m0 => 'mechanism',
617 s0 => 'source',
618 t0 => 'translation',
619 x0 => 't_private',
620 };
621 48 my $others =
622 {
623 x_ => 'private',
624 };
625 48 my $map =
626 [
627 unicode => { prefix => 'u', data => $unicodes },
628 # und-u-ka-noignore
629 collation => { prefix => 'u', data => $collation },
630 transform => { prefix => 't', data => $transform },
631 ];
632 48 my $result = {};
633 48 ▶ for( my $i = 0; $i < scalar( @$map ); $i += 2 )
Branch: 1 branch
BranchTrueFalseTotal
if ($i < scalar @$map) 144 48 192
634 {
635 144 my $type = $map->[$i];
636 144 my $dict = $map->[$i + 1];
637 144 my $prefix = $dict->{prefix};
638 144 my $ref = $dict->{data};
639 144 foreach my $tag ( sort( keys( %$ref ) ) )
640 {
641 1776 my $meth;
642 1776 my $def = {};
643 1776 ▶ if( ref( $ref->{ $tag } ) eq 'HASH' )
Branch: 1 branch
BranchTrueFalseTotal
if (ref $ref->{$tag} eq 'HASH') { } 240 1536 1776
644 {
645 240 $def = $ref->{ $tag };
646 240 $meth = $def->{method};
647 }
648 else
649 {
650 1536 $meth = $ref->{ $tag };
651 }
652 1776 my $code;
653 1776 ▶ unless( $code = $PROP_TO_SUB->{ $tag } )
Branch: 1 branch
BranchTrueFalseTotal
unless ($code = $Locale::Unicode::PROP_TO_SUB->{$tag}) 36 1740 1776
654 {
655 36 ▶ $code = $self->can( $meth ) || die( "Unknown method '${meth}' for ${type} subtag '${tag}'" );
Condition50%1/2
$self->can($meth) || die("Unknown method '${meth}' for $type subtag '${tag}'")
l!l
360
MC/DC0%0/1
$self->can($meth) || die("Unknown method '${meth}' for $type subtag '${tag}'")
$self->can($meth)
Truth table50%1/2
A
A= $self->can($meth)
Aresult
11
00
656 36 $PROP_TO_SUB->{ $tag } = $code;
657 }
658  
659 1776 my $val = $code->( $self );
660 1776 ▶ next if( !defined( $val ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $val 1759 17 1776
661 17 ▶ $result->{ $prefix } = [] if( !exists( $result->{ $prefix } ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $result->{$prefix} 10 7 17
662 17 ▶ if( exists( $def->{type} ) && $def->{type} eq 'boolean' )
Branch: 1 branch
BranchTrueFalseTotal
if (exists $def->{'type'} and $def->{'type'} eq 'boolean') { } 0 17 17
Condition33%1/3
exists $def->{"type"} and $def->{"type"} eq "boolean"
!ll&&!rl&&r
1700
MC/DC0%0/2
exists $def->{"type"} and $def->{"type"} eq "boolean"
exists $def->{"type"} $def->{"type"} eq "boolean"
Truth table33%1/3
A and B
A= exists $def->{"type"}B= $def->{"type"} eq "boolean"
ABresult
0X0
100
111
663 {
664 # We are explicit about the true value, but it could be ignored and be implicit.
665 # push( @{$result->{ $prefix }}, join( '-', $tag, ( $val ? 'true' : 'false' ) ) );
666 0 ▶ push( @{$result->{ $prefix }}, ( $EXPLICIT_BOOLEAN ? join( '-', $tag, ( $val ? 'true' : 'false' ) ) : ( $val ? $tag : join( '-', $tag, 'false' ) ) ) );
Branch: 3 branches
BranchTrueFalseTotal
$Locale::Unicode::EXPLICIT_BOOLEAN ? : 0 0 0
$val ? : 0 0 0
$val ? : 0 0 0
667 }
668 else
669 {
670 17 push( @{$result->{ $prefix }}, join( '-', $tag, $val ) );
671 }
672 }
673 }
674 48 my @parts = ();
675  
676 48 push( @parts, $self->core );
677  
678 48 ▶ if( my $transform_locale = $self->transform_locale )
Branch: 2 branches
BranchTrueFalseTotal
if (my $transform_locale = $self->transform_locale) { } 9 39 48
elsif (exists $result->{'t'} and ref $result->{'t'} eq 'ARRAY' and scalar @{$result->{'t'};}) { } 0 78 78
679 {
680 9 unshift( @{$result->{t}}, $transform_locale );
681 }
682 # There is no transformation locale and yet the user has set some transformation subtags.
683 # We warn the user about it.
684 ▶ elsif( exists( $result->{t} ) &&
Condition40%2/5
exists $result->{"t"} and ref $result->{"t"} eq "ARRAY" and scalar @{$result->{"t"};}
!ll
390
exists $result->{"t"} and ref $result->{"t"} eq "ARRAY"
!ll&&!rl&&r
3900
MC/DC0%0/2
exists $result->{"t"} and ref $result->{"t"} eq "ARRAY" and scalar @{$result->{"t"};}
exists $result->{"t"} ref $result->{"t"} eq "ARRAY"
Truth table33%1/3
A and B
A= exists $result->{"t"}B= ref $result->{"t"} eq "ARRAY"
ABresult
0X0
100
111
685 ref( $result->{t} ) eq 'ARRAY' &&
686 0 scalar( @{$result->{t}} ) )
687 {
688 0 ▶ warn( "You are attempting at setting ", scalar( @{$result->{t}} ), " transform subtags without declaring a transformation locale." ) if( warnings::enabled() );
Branch: 1 branch
BranchTrueFalseTotal
if warnings::enabled() 0 0 0
689 }
690  
691 48 foreach my $pref ( qw( u t ) )
692 {
693 96 ▶ if( exists( $result->{ $pref } ) )
Branch: 1 branch
BranchTrueFalseTotal
if (exists $result->{$pref}) 13 83 96
694 {
695 13 push( @parts, join( '-', $pref, join( '-', @{$result->{ $pref }} ) ) );
696 }
697 }
698 48 ▶ if( my $private = $self->private )
Branch: 1 branch
BranchTrueFalseTotal
if (my $private = $self->private) 2 46 48
699 {
700 2 push( @parts, "x-${private}" );
701 }
702 48 my $rv = join( '-', @parts );
703 48 $self->{_cache_value} = $rv;
704 48 CORE::delete( $self->{_reset} );
705 48 return( $rv );
706 }
707  
708 sub base
709 6 ▶{
Subroutine base: called CC=13 SCAR=29.4
Pod documented
710 6 my $self = shift( @_ );
711 6 ▶ if( @_ )
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 2 4 6
712 {
713 2 my $base = shift( @_ );
714 2 ▶ unless( Scalar::Util::blessed( $base ) &&
Branch: 1 branch
BranchTrueFalseTotal
unless (builtin::blessed($base) and $base->isa("Locale::Unicode")) 2 0 2
Condition33%1/3
builtin::blessed($base) and $base->isa("Locale::Unicode")
!ll&&!rl&&r
200
MC/DC0%0/2
builtin::blessed($base) and $base->isa("Locale::Unicode")
builtin::blessed($base) $base->isa("Locale::Unicode")
Truth table33%1/3
A and B
A= builtin::blessed($base)B= $base->isa("Locale::Unicode")
ABresult
0X0
100
111
715 $base->isa( 'Locale::Unicode' ) )
716 {
717 2 ▶ $base = Locale::Unicode->new( "$base" ) ||
Condition50%1/2
'Locale::Unicode'->new("$base") || (return $self->pass_error)
l!l
20
MC/DC0%0/1
'Locale::Unicode'->new("$base") || (return $self->pass_error)
'Locale::Unicode'->new("$base")
Truth table50%1/2
A
A= 'Locale::Unicode'->new("$base")
Aresult
11
00
718 return( $self->pass_error );
719 }
720 # $base = $base->canonical;
721 2 ▶ if( my $lang = $base->language_id )
Branch: 1 branch
BranchTrueFalseTotal
if (my $lang = $base->language_id) { } 2 0 2
722 {
723 2 $self->language_id( $lang );
724 }
725 else
726 {
727 0 $self->language_id( undef );
728 }
729  
730 2 ▶ if( my $script = $base->script )
Branch: 1 branch
BranchTrueFalseTotal
if (my $script = $base->script) { } 0 2 2
731 {
732 0 $self->script( $script );
733 }
734 else
735 {
736 2 $self->script( undef );
737 }
738  
739 2 ▶ if( my $territory = $base->territory )
Branch: 1 branch
BranchTrueFalseTotal
if (my $territory = $base->territory) { } 2 0 2
740 {
741 2 ▶ $self->territory( $territory ) ||
Branch: 1 branch
BranchTrueFalseTotal
$self->territory($territory) or return $self->pass_error 2 0 2
742 return( $self->pass_error );
743 }
744 else
745 {
746 0 $self->territory( undef );
747 }
748  
749 2 my $ref;
750 2 ▶ if( ( $ref = $base->variants ) &&
Branch: 1 branch
BranchTrueFalseTotal
if ($ref = $base->variants and ref($ref // '') eq 'ARRAY' and scalar @$ref) { } 1 1 2
Condition42%3/7
$ref = $base->variants and ref($ref // "") eq "ARRAY" and scalar @$ref
!ll
02
$ref = $base->variants and ref($ref // "") eq "ARRAY"
!ll&&!rl&&r
002
$ref // ""
l!l
20
MC/DC0%0/2
$ref = $base->variants and ref($ref // "") eq "ARRAY" and scalar @$ref
$ref = $base->variants $ref
Truth table33%1/3
A and B
A= $ref = $base->variantsB= $ref
ABresult
0X0
100
111
751 ref( $ref // '' ) eq 'ARRAY' &&
752 scalar( @$ref ) )
753 {
754 1 local $" = '-';
755 1 $self->variant( "@$ref" );
756 }
757 else
758 {
759 1 $self->variant( undef );
760 }
761 }
762 6 return( $self->core );
763 }
764  
765 # u-dx
766 48 ▶sub break_exclusion { return( shift->reset(@_)->_set_get_prop( 'break_exclusion', @_ ) ); }
Subroutine break_exclusion: called CC=1 SCAR=0.0
Pod documented
767  
768 # u-ca
769 4 ▶sub ca { return( shift->calendar( @_ ) ); }
Subroutine ca: called CC=1 SCAR=0.0
Pod documented
770  
771 54 ▶sub calendar { return( shift->reset(@_)->_set_get_prop( 'calendar', @_ ) ); }
Subroutine calendar: called CC=1 SCAR=0.0
Pod documented
772  
773 # NOTE: canonical -> specs <https://unicode.org/reports/tr35/tr35.html#Canonical_Unicode_Locale_Identifiers>
774 # <https://unicode.org/reports/tr35/tr35.html#LocaleId_Canonicalization>
775 # <https://unicode.org/reports/tr35/tr35.html#5.-canonicalizing-syntax>
776 sub canonical
777 3 ▶{
Subroutine canonical: called CC=16 SCAR=32.4
Pod documented
778 3 my $self = shift( @_ );
779 3 local $EXPLICIT_BOOLEAN = 0;
780 3 my $clone = Locale::Unicode->new( "$self" );
781 3 ▶ if( my $privateuse = $clone->privateuse )
Branch: 2 branches
BranchTrueFalseTotal
if (my $privateuse = $clone->privateuse) { } 0 3 3
elsif (my $grandfathered = $clone->grandfathered) { } 0 3 3
782 {
783 0 return( $clone );
784 }
785 elsif( my $grandfathered = $clone->grandfathered )
786 {
787 0 return( $clone );
788 }
789  
790 3 ▶ if( my $variant = $self->variant )
Branch: 1 branch
BranchTrueFalseTotal
if (my $variant = $self->variant) 1 2 3
791 {
792 # Make sure we have unique variants
793 # "The sequence of variant subtags must not have any duplicates (eg, de-1996-fonipa-1996 is not syntactically well-formed)."
794 # <https://unicode.org/reports/tr35/tr35.html#Unicode_language_identifier>
795 my $uniq = sub
796 1 ▶ {
Subroutine __ANON__: called CC=1 SCAR=0.0
797 1 my %seen;
798 1 grep( !$seen{ $_ }++, @_ );
799 1 };
800 1 my $variant2 = join( '-', $uniq->( sort( map( lc( $_ ), split( /-/, $variant ) ) ) ) );
801 1 ▶ $clone->variant( $variant2 ) if( $variant2 ne $variant );
Branch: 1 branch
BranchTrueFalseTotal
if $variant2 ne $variant 1 0 1
802 }
803  
804 # We query the country_code method only, because territory includes both world region
805 # and country code, and world region is only digits that do not need to be in uppercase
806 3 ▶ if( my $country_code = $self->country_code )
Branch: 1 branch
BranchTrueFalseTotal
if (my $country_code = $self->country_code) 1 2 3
807 {
808 1 my $cc = uc( $country_code );
809 1 ▶ $clone->country_code( $cc ) if( $cc ne $country_code );
Branch: 1 branch
BranchTrueFalseTotal
if $cc ne $country_code 1 0 1
810 }
811  
812 3 ▶ if( my $script = $self->script )
Branch: 1 branch
BranchTrueFalseTotal
if (my $script = $self->script) 1 2 3
813 {
814 1 my $script2 = ucfirst( lc( $script ) );
815 1 ▶ $clone->script( $script2 ) if( $script2 ne $script );
Branch: 1 branch
BranchTrueFalseTotal
if $script2 ne $script 1 0 1
816 }
817  
818 3 my( $lang, $lang3 );
819 3 ▶ if( ( $lang = $self->language ) ||
Branch: 1 branch
BranchTrueFalseTotal
if ($lang = $self->language or $lang3 = $self->language3) { } 3 0 3
Condition33%1/3
$lang = $self->language or $lang3 = $self->language3
l!l&&r!l&&!r
300
MC/DC0%0/2
$lang = $self->language or $lang3 = $self->language3
$lang = $self->language $lang3 = $self->language3
Truth table33%1/3
A or B
A= $lang = $self->languageB= $lang3 = $self->language3
ABresult
1X1
011
000
820 ( $lang3 = $self->language3 ) )
821 {
822 # <https://unicode.org/reports/tr35/tr35.html#Unicode_Locale_Identifier_BCP_47_to_CLDR>
823 # "the primary language subtag "und" is replaced with "root" if no script, region, or variant subtags are present."
824 # Hmmm, I am really reluctant to do this, because other parts of the LDML indicates we should stick with dash and use 'und' and 'root' is not compliant with RFC standard that a language ID should be 2 to 3-characters
825 # if( !$locale->script &&
826 # !$locale->territory &&
827 # !$locale->variant )
828 # {
829 # $locale->language( 'root' );
830 # }
831 3 ▶ if( $lang )
Branch: 2 branches
BranchTrueFalseTotal
if ($lang) { } 3 0 3
elsif ($lang3) { } 0 0 0
832 {
833 3 my $lang_canon = lc( $lang );
834 3 ▶ if( $lang_canon eq 'root' )
Branch: 2 branches
BranchTrueFalseTotal
if ($lang_canon eq 'root') { } 1 2 3
elsif ($lang_canon ne $lang) { } 0 2 2
835 {
836 1 $clone->language3( 'und' );
837 }
838 elsif( $lang_canon ne $lang )
839 {
840 0 $clone->language( $lang_canon );
841 }
842 }
843 elsif( $lang3 )
844 {
845 0 my $lang_canon = lc( $lang3 );
846 0 ▶ $clone->language3( $lang_canon ) if( $lang_canon ne $lang3 );
Branch: 1 branch
BranchTrueFalseTotal
if $lang_canon ne $lang3 0 0 0
847 }
848 }
849 else
850 {
851 0 $clone->language( 'und' );
852 }
853 3 return( $clone );
854 }
855  
856 # u-cf
857 0 ▶sub cf { return( shift->cu_format( @_ ) ); }
Subroutine cf: not called CC=1 SCAR=6.9
Pod documented
858  
859 sub clone
860 0 ▶{
Subroutine clone: not called CC=2 SCAR=17.9
Pod documented
861 0 my $self = shift( @_ );
862 0 ▶ my $new = $self->new( "$self" ) || return( $self->pass_error );
Condition0%0/2
$self->new("$self") || (return $self->pass_error)
l!l
00
MC/DC0%0/1
$self->new("$self") || (return $self->pass_error)
$self->new("$self")
Truth table0%0/2
A
A= $self->new("$self")
Aresult
11
00
863 0 return( $new );
864 }
865  
866 # u-co
867 1 ▶sub co { return( shift->collation( @_ ) ); }
Subroutine co: called CC=1 SCAR=0.0
Pod documented
868  
869 # u-ka
870 50 ▶sub colAlternate { return( shift->reset(@_)->_set_get_prop({
Subroutine colAlternate: called CC=1 SCAR=0.0
Pod documented
871 field => 'col_alternate',
872 regexp => qr/[[:alnum:]][[:alnum:]\-]+/,
873 }, @_ ) ); }
874  
875 # u-kb
876 48 ▶sub colBackwards { return( shift->reset(@_)->_set_get_prop({
Subroutine colBackwards: called CC=1 SCAR=0.0
Pod documented
877 field => 'col_backwards',
878 type => 'boolean',
879 }, @_ ) ); }
880  
881 # u-kc
882 48 ▶sub colCaseLevel { return( shift->reset(@_)->_set_get_prop({
Subroutine colCaseLevel: called CC=1 SCAR=0.0
Pod documented
883 field => 'col_case_level',
884 type => 'boolean',
885 }, @_ ) ); }
886  
887 # u-kf
888 52 ▶sub colCaseFirst { return( shift->reset(@_)->_set_get_prop({
Subroutine colCaseFirst: called CC=1 SCAR=0.0
Pod documented
889 field => 'col_case_first',
890 # lower, upper, undef
891 regexp => qr/[[:alnum:]]+/,
892 }, @_ ) ); }
893  
894 # u-co
895 50 ▶sub collation { return( shift->reset(@_)->_set_get_prop({
Subroutine collation: called CC=1 SCAR=0.0
Pod documented
896 field => 'collation',
897 regexp => qr/[[:alnum:]]+/,
898 }, @_ ) ); }
899  
900 # u-kh
901 48 ▶sub colHiraganaQuaternary { return( shift->reset(@_)->_set_get_prop({
Subroutine colHiraganaQuaternary: called CC=1 SCAR=0.0
Pod documented
902 field => 'col_hiragana_quaternary',
903 type => 'boolean',
904 }, @_ ) ); }
905  
906 0 ▶sub colNormalisation { return( shift->colNormalization( @_ ) ); }
Subroutine colNormalisation: not called CC=1 SCAR=6.9
Pod documented
907  
908 # u-kk
909 48 ▶sub colNormalization { return( shift->reset(@_)->_set_get_prop({
Subroutine colNormalization: called CC=1 SCAR=0.0
Pod documented
910 field => 'col_normalisation',
911 type => 'boolean',
912 }, @_ ) ); }
913  
914 # u-kn
915 48 ▶sub colNumeric { return( shift->reset(@_)->_set_get_prop({
Subroutine colNumeric: called CC=1 SCAR=0.0
Pod documented
916 field => 'col_numeric',
917 type => 'boolean',
918 }, @_ ) ); }
919  
920 # u-kr
921 48 ▶sub colReorder { return( shift->reset(@_)->_set_get_prop({
Subroutine colReorder: called CC=1 SCAR=0.0
Pod documented
922 field => 'col_reorder',
923 regexp => qr/[[:alnum:]][[:alnum:]\-]+/,
924 }, @_ ) ); }
925  
926 # u-ks
927 48 ▶sub colStrength { return( shift->reset(@_)->_set_get_prop({
Subroutine colStrength: called CC=1 SCAR=0.0
Pod documented
928 field => 'col_strength',
929 regexp => qr/[[:alnum:]][[:alnum:]\-]+/,
930 }, @_ ) ); }
931  
932 # u-kv
933 48 ▶sub colValue { return( shift->reset(@_)->_set_get_prop({
Subroutine colValue: called CC=1 SCAR=0.0
Pod documented
934 field => 'col_value',
935 regexp => qr/[[:alnum:]]+/,
936 }, @_ ) ); }
937  
938 # u-vt
939 48 ▶sub colVariableTop { return( shift->reset(@_)->_set_get_prop({
Subroutine colVariableTop: called CC=1 SCAR=0.0
Pod documented
940 field => 'col_variable_top',
941 regexp => qr/[[:alnum:]]+/,
942 }, @_ ) ); }
943  
944 sub core
945 61 ▶{
Subroutine core: called CC=10 SCAR=23.2
Pod documented
946 61 my $self = shift( @_ );
947 61 my @locale_parts = ();
948 61 ▶ if( my $privateuse = $self->privateuse )
Branch: 2 branches
BranchTrueFalseTotal
if (my $privateuse = $self->privateuse) { } 1 60 61
elsif (my $grandfathered = $self->grandfathered) { } 2 58 60
949 {
950 1 push( @locale_parts, 'x-' . $privateuse );
951 }
952 elsif( my $grandfathered = $self->grandfathered )
953 {
954 2 push( @locale_parts, $grandfathered );
955 }
956 else
957 {
958 58 ▶ if( my $lang = $self->language )
Branch: 2 branches
BranchTrueFalseTotal
if (my $lang = $self->language) { } 48 10 58
elsif (my $lang3 = $self->language3) { } 10 0 10
959 {
960 48 push( @locale_parts, $lang );
961 }
962 elsif( my $lang3 = $self->language3 )
963 {
964 10 push( @locale_parts, $lang3 );
965 }
966 # 'und' for 'undefined'
967 else
968 {
969 0 push( @locale_parts, 'und' );
970 }
971  
972 58 ▶ if( my $extended = $self->extended )
Branch: 1 branch
BranchTrueFalseTotal
if (my $extended = $self->extended) 4 54 58
973 {
974 4 push( @locale_parts, $extended );
975 }
976  
977 58 ▶ if( my $script = $self->script )
Branch: 1 branch
BranchTrueFalseTotal
if (my $script = $self->script) 15 43 58
978 {
979 15 push( @locale_parts, $script );
980 }
981  
982 58 ▶ if( my $cc = $self->country_code )
Branch: 2 branches
BranchTrueFalseTotal
if (my $cc = $self->country_code) { } 26 32 58
elsif (my $region = $self->region) { } 0 32 32
983 {
984 26 push( @locale_parts, $cc );
985 }
986 elsif( my $region = $self->region )
987 {
988 0 push( @locale_parts, $region );
989 }
990  
991 58 ▶ if( my $variant = $self->variant )
Branch: 1 branch
BranchTrueFalseTotal
if (my $variant = $self->variant) 10 48 58
992 {
993 10 push( @locale_parts, $variant );
994 }
995 }
996 61 return( join( '-', @locale_parts ) );
997 }
998  
999 106 ▶sub country_code { return( shift->reset(@_)->_set_get_prop({
Subroutine country_code: called CC=1 SCAR=0.0
Pod documented
1000 field => 'country_code',
1001 on_update => sub
1002 29 ▶ {
Subroutine __ANON__: called CC=1 SCAR=0.0
1003 29 $_[0]->{region} = undef;
1004 29 $_[0]->{overlong} = undef;
1005 },
1006 106 }, @_ ) ); }
1007  
1008 # u-cf
1009 48 ▶sub cu_format { return( shift->reset(@_)->_set_get_prop( 'cu_format', @_ ) ); }
Subroutine cu_format: called CC=1 SCAR=0.0
Pod documented
1010  
1011 # u-cu
1012 0 ▶sub cu { return( shift->reset(@_)->_set_get_prop( 'currency', @_ ) ); }
Subroutine cu: not called CC=1 SCAR=6.9
Pod documented
1013  
1014 # u-cu
1015 48 ▶sub currency { return( shift->reset(@_)->_set_get_prop( 'currency', @_ ) ); }
Subroutine currency: called CC=1 SCAR=0.0
Pod documented
1016  
1017 # t-d0
1018 0 ▶sub d0 { return( shift->reset(@_)->_set_get_prop( 'destination', @_ ) ); }
Subroutine d0: not called CC=1 SCAR=6.9
Pod documented
1019  
1020 # t-d0
1021 0 ▶sub dest { return( shift->reset(@_)->_set_get_prop( 'destination', @_ ) ); }
Subroutine dest: not called CC=1 SCAR=6.9
Pod documented
1022  
1023 # t-d0
1024 48 ▶sub destination { return( shift->reset(@_)->_set_get_prop( 'destination', @_ ) ); }
Subroutine destination: called CC=1 SCAR=0.0
Pod documented
1025  
1026 # u-dx
1027 0 ▶sub dx { return( shift->reset(@_)->_set_get_prop( 'break_exclusion', @_ ) ); }
Subroutine dx: not called CC=1 SCAR=6.9
Pod documented
1028  
1029 # u-em
1030 0 ▶sub em { return( shift->reset(@_)->_set_get_prop( 'emoji', @_ ) ); }
Subroutine em: not called CC=1 SCAR=6.9
Pod documented
1031  
1032 # u-em
1033 48 ▶sub emoji { return( shift->reset(@_)->_set_get_prop( 'emoji', @_ ) ); }
Subroutine emoji: called CC=1 SCAR=0.0
Pod documented
1034  
1035 sub error
1036 1 ▶{
Subroutine error: called CC=7 SCAR=28.4
Pod documented
1037 1 my $self = shift( @_ );
1038 1 ▶ if( @_ )
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 1 0 1
1039 {
1040 1 ▶ my $msg = join( '', map( ( ref( $_ ) eq 'CODE' ) ? $_->() : $_, @_ ) );
Branch: 1 branch
BranchTrueFalseTotal
ref $_ eq 'CODE' ? : 0 1 1
1041 1 $self->{error} = $ERROR = Locale::Unicode::Exception->new({
1042 skip_frames => 1,
1043 message => $msg,
1044 });
1045 1 ▶ if( $self->fatal )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->fatal) { } 1 0 1
1046 {
1047 1 die( $self->{error} );
1048 }
1049 else
1050 {
1051 0 ▶ warn( $msg ) if( warnings::enabled() );
Branch: 1 branch
BranchTrueFalseTotal
if warnings::enabled() 0 0 0
1052 0 ▶ rreturn( Locale::Unicode::NullObject->new ) if( want( 'OBJECT' ) );
Branch: 1 branch
BranchTrueFalseTotal
if want("OBJECT") 0 0 0
1053 0 return;
1054 }
1055 }
1056 0 ▶ return( ref( $self ) ? $self->{error} : $ERROR );
Branch: 1 branch
BranchTrueFalseTotal
ref $self ? : 0 0 0
1057 }
1058  
1059 74 ▶sub extended { return( shift->reset(@_)->_set_get_prop( 'extended', @_ ) ); }
Subroutine extended: called CC=1 SCAR=0.0
Pod documented
1060  
1061 0 ▶sub false { return( $Locale::Unicode::Boolean::false ); }
Subroutine false: not called CC=1 SCAR=6.9
Pod documented
1062  
1063 3 ▶sub fatal { return( shift->_set_get_prop( 'fatal', @_ ) ); }
Subroutine fatal: called CC=1 SCAR=0.0
Pod documented
1064  
1065 # u-fw
1066 48 ▶sub first_day { return( shift->reset(@_)->_set_get_prop( 'first_day', @_ ) ); }
Subroutine first_day: called CC=1 SCAR=0.0
Pod documented
1067  
1068 # u-fw
1069 0 ▶sub fw { return( shift->reset(@_)->_set_get_prop( 'first_day', @_ ) ); }
Subroutine fw: not called CC=1 SCAR=6.9
Pod documented
1070  
1071 sub grandfathered
1072 65 ▶{
Subroutine grandfathered: called CC=7 SCAR=21.1
Pod documented
1073 65 my $self = shift( @_ );
1074 65 ▶ if( @_ )
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 2 63 65
1075 {
1076 2 my $val = shift( @_ );
1077 2 $self->reset(1);
1078 2 ▶ if( !defined( $val ) )
Branch: 3 branches
BranchTrueFalseTotal
if (not defined $val) { } 0 2 2
elsif ($val =~ /^$Locale::Unicode::GRANDFATHERED_IRREGULAR$/) { } 1 1 2
elsif ($val =~ /^$Locale::Unicode::GRANDFATHERED_REGULAR$/) { } 1 0 1
1079 {
1080 0 $self->_set_get_prop( 'grandfathered_irregular', undef );
1081 0 $self->_set_get_prop( 'grandfathered_regular', undef );
1082 }
1083 elsif( $val =~ /^$GRANDFATHERED_IRREGULAR$/ )
1084 {
1085 1 $self->grandfathered_irregular( $val );
1086 }
1087 elsif( $val =~ /^$GRANDFATHERED_REGULAR$/ )
1088 {
1089 1 $self->grandfathered_regular( $val );
1090 }
1091 else
1092 {
1093 0 ▶ warn( "Value provided does not seem to be either a regular or irregular grandfathered language tag." ) if( warnings::enabled() );
Branch: 1 branch
BranchTrueFalseTotal
if warnings::enabled() 0 0 0
1094 }
1095 }
1096 65 ▶ return( $self->_set_get_prop( 'grandfathered_irregular' ) || $self->_set_get_prop( 'grandfathered_regular' ) );
Condition100%3/3
$self->_set_get_prop('grandfathered_irregular') || $self->_set_get_prop('grandfathered_regular')
l!l&&r!l&&!r
2261
MC/DC100%2/2
$self->_set_get_prop('grandfathered_irregular') || $self->_set_get_prop('grandfathered_regular')
$self->_set_get_prop('grandfathered_irregular') $self->_set_get_prop('grandfathered_regular')
Truth table100%3/3
A || B
A= $self->_set_get_prop('grandfathered_irregular')B= $self->_set_get_prop('grandfathered_regular')
ABresult
1X1
011
000
1097 }
1098  
1099 47 ▶sub grandfathered_irregular { return( shift->reset(@_)->_set_get_prop( {
Subroutine grandfathered_irregular: called CC=1 SCAR=0.0
Pod documented
1100 field => 'grandfathered_irregular',
1101 on_update => sub
1102 18 ▶ {
Subroutine __ANON__: called CC=1 SCAR=0.0
1103 18 $_[0]->{language} = undef;
1104 18 $_[0]->{language3} = undef;
1105 18 $_[0]->{privateuse} = undef;
1106 18 $_[0]->{grandfathered_regular} = undef;
1107 },
1108 47 }, @_ ) ); }
1109  
1110 39 ▶sub grandfathered_regular { return( shift->reset(@_)->_set_get_prop( {
Subroutine grandfathered_regular: called CC=1 SCAR=0.0
Pod documented
1111 field => 'grandfathered_regular',
1112 on_update => sub
1113 10 ▶ {
Subroutine __ANON__: called CC=1 SCAR=0.0
1114 10 $_[0]->{language} = undef;
1115 10 $_[0]->{language3} = undef;
1116 10 $_[0]->{privateuse} = undef;
1117 10 $_[0]->{grandfathered_irregular} = undef;
1118 },
1119 39 }, @_ ) ); }
1120  
1121 # t-h0
1122 0 ▶sub h0 { return( shift->reset(@_)->_set_get_prop( 'hybrid', @_ ) ); }
Subroutine h0: not called CC=1 SCAR=6.9
Pod documented
1123  
1124 # u-hc
1125 0 ▶sub hc { return( shift->reset(@_)->_set_get_prop( 'hour_cycle', @_ ) ); }
Subroutine hc: not called CC=1 SCAR=6.9
Pod documented
1126  
1127 # u-hc
1128 48 ▶sub hour_cycle { return( shift->reset(@_)->_set_get_prop( 'hour_cycle', @_ ) ); }
Subroutine hour_cycle: called CC=1 SCAR=0.0
Pod documented
1129  
1130 # t-h0
1131 48 ▶sub hybrid { return( shift->reset(@_)->_set_get_prop( 'hybrid', @_ ) ); }
Subroutine hybrid: called CC=1 SCAR=0.0
Pod documented
1132  
1133 # t-i0
1134 0 ▶sub i0 { return( shift->reset(@_)->_set_get_prop( 'input', @_ ) ); }
Subroutine i0: not called CC=1 SCAR=6.9
Pod documented
1135  
1136 # t-i0
1137 48 ▶sub input { return( shift->reset(@_)->_set_get_prop( 'input', @_ ) ); }
Subroutine input: called CC=1 SCAR=0.0
Pod documented
1138  
1139 # t-k0
1140 0 ▶sub k0 { return( shift->reset(@_)->_set_get_prop( 'keyboard', @_ ) ); }
Subroutine k0: not called CC=1 SCAR=6.9
Pod documented
1141  
1142 # u-ka
1143 1 ▶sub ka { return( shift->colAlternate( @_ ) ); }
Subroutine ka: called CC=1 SCAR=0.0
Pod documented
1144  
1145 # u-kb
1146 0 ▶sub kb { return( shift->colBackwards( @_ ) ); }
Subroutine kb: not called CC=1 SCAR=6.9
Pod documented
1147  
1148 # u-kc
1149 0 ▶sub kc { return( shift->colCaseLevel( @_ ) ); }
Subroutine kc: not called CC=1 SCAR=6.9
Pod documented
1150  
1151 # t-k0
1152 48 ▶sub keyboard { return( shift->reset(@_)->_set_get_prop( 'keyboard', @_ ) ); }
Subroutine keyboard: called CC=1 SCAR=0.0
Pod documented
1153  
1154 # u-kf
1155 0 ▶sub kf { return( shift->colCaseFirst( @_ ) ); }
Subroutine kf: not called CC=1 SCAR=6.9
Pod documented
1156  
1157 # u-kh
1158 0 ▶sub kh { return( shift->colHiraganaQuaternary( @_ ) ); }
Subroutine kh: not called CC=1 SCAR=6.9
Pod documented
1159  
1160 # u-kk
1161 0 ▶sub kk { return( shift->colNormalization( @_ ) ); }
Subroutine kk: not called CC=1 SCAR=6.9
Pod documented
1162  
1163 # u-kn
1164 0 ▶sub kn { return( shift->colNumeric( @_ ) ); }
Subroutine kn: not called CC=1 SCAR=6.9
Pod documented
1165  
1166 # u-kr
1167 0 ▶sub kr { return( shift->colReorder( @_ ) ); }
Subroutine kr: not called CC=1 SCAR=6.9
Pod documented
1168  
1169 # u-ks
1170 0 ▶sub ks { return( shift->colStrength( @_ ) ); }
Subroutine ks: not called CC=1 SCAR=6.9
Pod documented
1171  
1172 # u-kv
1173 0 ▶sub kv { return( shift->colValue( @_ ) ); }
Subroutine kv: not called CC=1 SCAR=6.9
Pod documented
1174  
1175 166 ▶sub lang { return( shift->reset(@_)->_set_get_prop( {
Subroutine lang: called CC=1 SCAR=0.0
Pod documented
1176 field => 'language',
1177 on_update => sub
1178 57 ▶ {
Subroutine __ANON__: called CC=1 SCAR=0.0
1179 57 $_[0]->{language3} = undef;
1180 57 $_[0]->{grandfathered_irregular} = undef;
1181 57 $_[0]->{grandfathered_regular} = undef;
1182 57 $_[0]->{privateuse} = undef;
1183 },
1184 166 }, @_ ) ); }
1185  
1186 51 ▶sub lang3 { return( shift->reset(@_)->_set_get_prop( {
Subroutine lang3: called CC=1 SCAR=0.0
Pod documented
1187 field => 'language3',
1188 on_update => sub
1189 9 ▶ {
Subroutine __ANON__: called CC=1 SCAR=0.0
1190 9 $_[0]->{language} = undef;
1191 9 $_[0]->{grandfathered_irregular} = undef;
1192 9 $_[0]->{grandfathered_regular} = undef;
1193 9 $_[0]->{privateuse} = undef;
1194 },
1195 51 }, @_ ) ); }
1196  
1197 166 ▶sub language { return( shift->lang( @_ ) ); }
Subroutine language: called CC=1 SCAR=0.0
Pod documented
1198  
1199 sub language_extended
1200 5 ▶{
Subroutine language_extended: called CC=4 SCAR=13.9
Pod documented
1201 5 my $self = shift( @_ );
1202 5 my @parts = ();
1203 5 ▶ if( my $lang = $self->language )
Branch: 2 branches
BranchTrueFalseTotal
if (my $lang = $self->language) { } 4 1 5
elsif (my $lang3 = $self->language3) { } 1 0 1
1204 {
1205 4 push( @parts, $lang );
1206 }
1207 elsif( my $lang3 = $self->language3 )
1208 {
1209 1 push( @parts, $lang3 );
1210 }
1211  
1212 5 ▶ if( my $ext = $self->extended )
Branch: 1 branch
BranchTrueFalseTotal
if (my $ext = $self->extended) 2 3 5
1213 {
1214 2 push( @parts, $ext );
1215 }
1216 5 return( join( '-', @parts ) );
1217 }
1218  
1219 51 ▶sub language3 { return( shift->lang3( @_ ) ); }
Subroutine language3: called CC=1 SCAR=0.0
Pod documented
1220  
1221 sub language_id
1222 4 ▶{
Subroutine language_id: called CC=5 SCAR=18.7
Pod documented
1223 4 my $self = shift( @_ );
1224 4 ▶ if( @_ )
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 2 2 4
1225 {
1226 2 my $val = shift( @_ );
1227 2 ▶ if( !defined( $val ) )
Branch: 2 branches
BranchTrueFalseTotal
if (not defined $val) { } 0 2 2
elsif (length $val == 3) { } 0 2 2
1228 {
1229 0 $self->language( undef );
1230 0 $self->language3( undef );
1231 }
1232 elsif( length( $val ) == 3 )
1233 {
1234 0 $self->language3( $val );
1235 }
1236 # Should be a 2-characters language ID, but we are not going to enforce it.
1237 # This is the responsibility of the developer.
1238 else
1239 {
1240 2 $self->language( $val );
1241 }
1242 }
1243 4 ▶ return( $self->language || $self->language3 );
Condition33%1/3
$self->language || $self->language3
l!l&&r!l&&!r
400
MC/DC0%0/2
$self->language || $self->language3
$self->language $self->language3
Truth table33%1/3
A || B
A= $self->languageB= $self->language3
ABresult
1X1
011
000
1244 }
1245  
1246 # u-lb
1247 0 ▶sub lb { return( shift->reset(@_)->_set_get_prop( 'line_break', @_ ) ); }
Subroutine lb: not called CC=1 SCAR=6.9
Pod documented
1248  
1249 # u-lb
1250 48 ▶sub line_break { return( shift->reset(@_)->_set_get_prop( 'line_break', @_ ) ); }
Subroutine line_break: called CC=1 SCAR=0.0
Pod documented
1251  
1252 # u-lw
1253 48 ▶sub line_break_word { return( shift->reset(@_)->_set_get_prop( 'line_break_word', @_ ) ); }
Subroutine line_break_word: called CC=1 SCAR=0.0
Pod documented
1254  
1255 # NOTE: the term 'locale' is abusive, since a locale is the entire string, and the language is just this part
1256 0 ▶sub locale { return( shift->reset(@_)->_set_get_prop( 'language', @_ ) ); }
Subroutine locale: not called CC=1 SCAR=6.9
Pod documented
1257  
1258 0 ▶sub locale3 { return( shift->reset(@_)->_set_get_prop( 'language3', @_ ) ); }
Subroutine locale3: not called CC=1 SCAR=6.9
Pod documented
1259  
1260 # u-lw
1261 0 ▶sub lw { return( shift->reset(@_)->_set_get_prop( 'line_break_word', @_ ) ); }
Subroutine lw: not called CC=1 SCAR=6.9
Pod documented
1262  
1263 # t-m0
1264 1 ▶sub m0 { return( shift->mechanism( @_ ) ); }
Subroutine m0: called CC=1 SCAR=0.0
Pod documented
1265  
1266 sub matches
1267 1130 ▶{
Subroutine matches: called CC=4 SCAR=14.0
Pod documented
1268 1130 my $self = shift( @_ );
1269 1130 ▶ my $lang = shift( @_ ) || return( $self->error( "No language was provided." ) );
Condition50%1/2
shift @_ || (return $self->error('No language was provided.'))
l!l
11300
MC/DC0%0/1
shift @_ || (return $self->error('No language was provided.'))
shift @_
Truth table50%1/2
A
A= shift @_
Aresult
11
00
1270 # Required by RFC for parsing
1271 1130 $lang =~ tr/_/-/;
1272 # Special language 'root' becomes 'und' for 'undefined'
1273 # if( substr( lc( $lang ), 0, 5 ) eq 'root-' )
1274 # {
1275 # substr( $lang, 0, 4, 'und' );
1276 # }
1277 1130 ▶ if( $lang =~ /^$LOCALE_RE$/ )
Branch: 1 branch
BranchTrueFalseTotal
if ($lang =~ /^$Locale::Unicode::LOCALE_RE$/) 1129 1 1130
1278 {
1279 1129 my $re = {%+};
1280 1129 return( $re );
1281 }
1282 # Returns false with empty string, but not undef. Undef is reserved for errors
1283 1 ▶ return( wantarray() ? () : '' );
Branch: 1 branch
BranchTrueFalseTotal
wantarray ? : 0 1 1
1284 }
1285  
1286 # u-ms
1287 48 ▶sub measurement { return( shift->reset(@_)->_set_get_prop( 'measurement', @_ ) ); }
Subroutine measurement: called CC=1 SCAR=0.0
Pod documented
1288  
1289 # t-m0
1290 50 ▶sub mechanism { return( shift->reset(@_)->_set_get_prop( 'mechanism', @_ ) ); }
Subroutine mechanism: called CC=1 SCAR=0.0
Pod documented
1291  
1292 sub merge
1293 2 ▶{
Subroutine merge: called CC=13 SCAR=26.9
Pod documented
1294 2 my $self = shift( @_ );
1295 2 my @locales = @_;
1296 2 ▶ if( scalar( @_ ) != 1 )
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @_ != 1) 0 2 2
1297 {
1298 0 return( $self->error( "I expected 1 locale, but instead received ", scalar( @locales ), " locales." ) );
1299 }
1300 2 my $other = shift( @locales );
1301 2 ▶ unless( Scalar::Util::blessed( $other ) &&
Branch: 1 branch
BranchTrueFalseTotal
unless (builtin::blessed($other) and $other->isa("Locale::Unicode")) 0 2 2
Condition33%1/3
builtin::blessed($other) and $other->isa("Locale::Unicode")
!ll&&!rl&&r
002
MC/DC0%0/2
builtin::blessed($other) and $other->isa("Locale::Unicode")
builtin::blessed($other) $other->isa("Locale::Unicode")
Truth table33%1/3
A and B
A= builtin::blessed($other)B= $other->isa("Locale::Unicode")
ABresult
0X0
100
111
1302 $other->isa( 'Locale::Unicode' ) )
1303 {
1304 0 ▶ $other = Locale::Unicode->new( "$other" ) ||
Condition0%0/2
'Locale::Unicode'->new("$other") || (return $self->pass_error('Locale::Unicode'->error))
l!l
00
MC/DC0%0/1
'Locale::Unicode'->new("$other") || (return $self->pass_error('Locale::Unicode'->error))
'Locale::Unicode'->new("$other")
Truth table0%0/2
A
A= 'Locale::Unicode'->new("$other")
Aresult
11
00
1305 return( $self->pass_error( Locale::Unicode->error ) );
1306 }
1307 2 ▶ my @keys = grep{ exists( $PROP_TO_SUB->{ $_ } ) || $self->can( $_ ) } keys( %$self );
Condition100%3/3
exists $Locale::Unicode::PROP_TO_SUB->{$_} || $self->can($_)
l!l&&r!l&&!r
20544
MC/DC100%2/2
exists $Locale::Unicode::PROP_TO_SUB->{$_} || $self->can($_)
exists $Locale::Unicode::PROP_TO_SUB->{$_} $self->can($_)
Truth table100%3/3
A || B
A= exists $Locale::Unicode::PROP_TO_SUB->{$_}B= $self->can($_)
ABresult
1X1
011
000
1308 2 foreach my $prop ( @keys )
1309 {
1310 74 ▶ next if( $prop eq 'variant' );
Branch: 1 branch
BranchTrueFalseTotal
if $prop eq "variant" 2 72 74
1311 72 ▶ if( exists( $other->{ $prop } ) &&
Branch: 1 branch
BranchTrueFalseTotal
if (exists $other->{$prop} and defined $other->{$prop}) 6 66 72
Condition66%2/3
exists $other->{$prop} and defined $other->{$prop}
!ll&&!rl&&r
0666
MC/DC50%1/2
exists $other->{$prop} and defined $other->{$prop}
exists $other->{$prop} defined $other->{$prop}
Truth table66%2/3
A and B
A= exists $other->{$prop}B= defined $other->{$prop}
ABresult
0X0
100
111
1312 defined( $other->{ $prop } ) )
1313 {
1314 6 $self->$prop( $other->{ $prop } );
1315 }
1316 }
1317 2 my $ref;
1318 2 ▶ if( ( $ref = $other->variants ) &&
Branch: 1 branch
BranchTrueFalseTotal
if ($ref = $other->variants and scalar @$ref) 2 0 2
Condition50%1/2
$ref = $other->variants and scalar @$ref
!ll
02
MC/DC0%0/1
$ref = $other->variants and scalar @$ref
$ref = $other->variants
Truth table50%1/2
A
A= $ref = $other->variants
Aresult
00
11
1319 scalar( @$ref ) )
1320 {
1321 2 my $orig = $self->variants;
1322 2 ▶ if( scalar( @$orig ) )
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @$orig) { } 1 1 2
1323 {
1324 # Make sure we have unique keys
1325 my $uniq = sub
1326 1 ▶ {
Subroutine __ANON__: called CC=1 SCAR=0.0
1327 1 my %seen;
1328 1 grep( !$seen{ $_ }++, @_ );
1329 1 };
1330 1 my @variants = $uniq->( @$orig, @$ref );
1331 1 $self->variant( join( '-', @variants ) );
1332 }
1333 else
1334 {
1335 1 my $var = $other->variant;
1336 1 $self->variant( $var );
1337 }
1338 }
1339 2 return( $self );
1340 }
1341  
1342 # u-ms
1343 0 ▶sub ms { return( shift->measurement( @_ ) ); }
Subroutine ms: not called CC=1 SCAR=6.9
Pod documented
1344  
1345 # u-mu
1346 0 ▶sub mu { return( shift->unit( @_ ) ); }
Subroutine mu: not called CC=1 SCAR=6.9
Pod documented
1347  
1348 # u-nu
1349 1 ▶sub nu { return( shift->number( @_ ) ); }
Subroutine nu: called CC=1 SCAR=0.0
Pod documented
1350  
1351 # u-nu
1352 50 ▶sub number { return( shift->reset(@_)->_set_get_prop( 'number', @_ ) ); }
Subroutine number: called CC=1 SCAR=0.0
Pod documented
1353  
1354 5 ▶sub overlong { return( shift->reset(@_)->_set_get_prop( {
Subroutine overlong: called CC=1 SCAR=0.0
Pod documented
1355 field => 'overlong',
1356 on_update => sub
1357 1 ▶ {
Subroutine __ANON__: called CC=1 SCAR=0.0
1358 1 $_[0]->{country_code} = $_[1];
1359 1 $_[0]->{region} = undef;
1360 },
1361 5 }, @_ ) ); }
1362  
1363 sub parse
1364 104 ▶{
Subroutine parse: called CC=61 SCAR=58.1
Pod documented
1365 104 my $self = shift( @_ );
1366 104 ▶ my $this = shift( @_ ) || return( $self->error( "No language string was provided." ) );
Condition50%1/2
shift @_ || (return $self->error('No language string was provided.'))
l!l
1040
MC/DC0%0/1
shift @_ || (return $self->error('No language string was provided.'))
shift @_
Truth table50%1/2
A
A= shift @_
Aresult
11
00
1367 104 my $opts = $self->_get_args_as_hash( @_ );
1368 104 ▶ if( ref( $this ) &&
Branch: 1 branch
BranchTrueFalseTotal
if (ref $this and builtin::blessed($this) and overload::Method($this, "\"\"")) 0 104 104
Condition33%2/6
ref $this and builtin::blessed($this) and overload::Method($this, "\"\"")
!ll&&!rl&&r
10400
ref $this and builtin::blessed($this)
!ll&&!rl&&r
10400
MC/DC0%0/3
ref $this and builtin::blessed($this) and overload::Method($this, "\"\"")
ref $this builtin::blessed($this) overload::Method($this, "\"\"")
Truth table25%1/4
A and B and C
A= ref $thisB= builtin::blessed($this)C= overload::Method($this, "\"\"")
ABCresult
0XX0
10X0
1100
1111
1369 Scalar::Util::blessed( $this ) &&
1370 overload::Method( $this, '""' ) )
1371 {
1372 0 $this = "$this";
1373 }
1374  
1375 104 my $re = $self->matches( $this );
1376 104 ▶ return( $self->pass_error ) if( !defined( $opts ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $opts 0 104 104
1377  
1378 104 my $info = {};
1379 # Value provided failed to match the locale regular expression
1380 104 ▶ return( $info ) if( !$re );
Branch: 1 branch
BranchTrueFalseTotal
unless $re 1 103 104
1381 # "root" is treated as a special unicode_language_subtag
1382 # <https://unicode.org/reports/tr35/tr35.html#Unicode_language_identifier>
1383 103 ▶ if( exists( $re->{root} ) &&
Branch: 1 branch
BranchTrueFalseTotal
if (exists $re->{"root"} and defined $re->{"root"} and length $re->{"root"}) 4 99 103
Condition66%4/6
exists $re->{"root"} and defined $re->{"root"} and length $re->{"root"}
!ll&&!rl&&r
9904
exists $re->{"root"} and defined $re->{"root"}
!ll&&!rl&&r
9904
MC/DC33%1/3
exists $re->{"root"} and defined $re->{"root"} and length $re->{"root"}
exists $re->{"root"} defined $re->{"root"} length $re->{"root"}
Truth table50%2/4
A and B and C
A= exists $re->{"root"}B= defined $re->{"root"}C= length $re->{"root"}
ABCresult
0XX0
10X0
1100
1111
1384 defined( $re->{root} ) &&
1385 length( $re->{root} ) )
1386 {
1387 $re->{language} = delete( $re->{root} )
1388 4 }
1389 103 foreach my $prop ( qw( language language3 extended script country_code region variant privateuse grandfathered_irregular grandfathered_regular overlong ) )
1390 {
1391 # the property provided as an option can be undef by design to remove the value
1392 1133 ▶ if( exists( $opts->{ $prop } ) )
Branch: 2 branches
BranchTrueFalseTotal
if (exists $opts->{$prop}) { } 0 1133 1133
elsif (exists $re->{$prop} and defined $re->{$prop} and length $re->{$prop}) { } 168 1930 2098
1393 {
1394 0 $info->{ $prop } = $opts->{ $prop };
1395 }
1396 ▶ elsif( exists( $re->{ $prop } ) &&
Condition66%4/6
exists $re->{$prop} and defined $re->{$prop} and length $re->{$prop}
!ll&&!rl&&r
9650168
exists $re->{$prop} and defined $re->{$prop}
!ll&&!rl&&r
9650168
MC/DC33%1/3
exists $re->{$prop} and defined $re->{$prop} and length $re->{$prop}
exists $re->{$prop} defined $re->{$prop} length $re->{$prop}
Truth table50%2/4
A and B and C
A= exists $re->{$prop}B= defined $re->{$prop}C= length $re->{$prop}
ABCresult
0XX0
10X0
1100
1111
1397 defined( $re->{ $prop } ) &&
1398 length( $re->{ $prop } ) )
1399 {
1400 168 $info->{ $prop } = $re->{ $prop };
1401 }
1402 }
1403  
1404 103 ▶ if( exists( $re->{locale_bcp47} ) &&
Branch: 1 branch
BranchTrueFalseTotal
if (exists $re->{"locale_bcp47"} and defined $re->{"locale_bcp47"} and length $re->{"locale_bcp47"}) 103 0 103
Condition33%2/6
exists $re->{"locale_bcp47"} and defined $re->{"locale_bcp47"} and length $re->{"locale_bcp47"}
!ll&&!rl&&r
00103
exists $re->{"locale_bcp47"} and defined $re->{"locale_bcp47"}
!ll&&!rl&&r
00103
MC/DC0%0/3
exists $re->{"locale_bcp47"} and defined $re->{"locale_bcp47"} and length $re->{"locale_bcp47"}
exists $re->{"locale_bcp47"} defined $re->{"locale_bcp47"} length $re->{"locale_bcp47"}
Truth table25%1/4
A and B and C
A= exists $re->{"locale_bcp47"}B= defined $re->{"locale_bcp47"}C= length $re->{"locale_bcp47"}
ABCresult
0XX0
10X0
1100
1111
1405 defined( $re->{locale_bcp47} ) &&
1406 length( $re->{locale_bcp47} ) )
1407 {
1408 103 my $offset = length( $re->{locale_bcp47} );
1409 103 ▶ $offset++ if( substr( $this, $offset, 1 ) eq '-' );
Branch: 1 branch
BranchTrueFalseTotal
if substr($this, $offset, 1) eq "-" 25 78 103
1410 # substr( $this, 0, $offset, '' );
1411 103 $this = substr( $this, $offset );
1412 }
1413  
1414 103 ▶ if( ( exists( $re->{ext_transform} ) &&
Branch: 1 branch
BranchTrueFalseTotal
if (exists $re->{"ext_transform"} and defined $re->{"ext_transform"} and length $re->{"ext_transform"} or exists $re->{"transform_options"} and defined $re->{"transform_options"} and length $re->{"transform_options"}) 16 87 103
Condition53%8/15
exists $re->{"ext_transform"} and defined $re->{"ext_transform"} and length $re->{"ext_transform"} or exists $re->{"transform_options"} and defined $re->{"transform_options"} and length $re->{"transform_options"}
l!l&&r!l&&!r
16087
exists $re->{"ext_transform"} and defined $re->{"ext_transform"} and length $re->{"ext_transform"}
!ll&&!rl&&r
87016
exists $re->{"ext_transform"} and defined $re->{"ext_transform"}
!ll&&!rl&&r
87016
exists $re->{"transform_options"} and defined $re->{"transform_options"} and length $re->{"transform_options"}
!ll&&!rl&&r
8700
exists $re->{"transform_options"} and defined $re->{"transform_options"}
!ll&&!rl&&r
8700
MC/DC16%1/6
exists $re->{"ext_transform"} and defined $re->{"ext_transform"} and length $re->{"ext_transform"} or exists $re->{"transform_options"} and defined $re->{"transform_options"} and length $re->{"transform_options"}
exists $re->{"ext_transform"} defined $re->{"ext_transform"} length $re->{"ext_transform"} exists $re->{"transform_options"} defined $re->{"transform_options"} length $re->{"transform_options"}
Truth table15%2/13
A and B and C or D and E and F
A= exists $re->{"ext_transform"}B= defined $re->{"ext_transform"}C= length $re->{"ext_transform"}D= exists $re->{"transform_options"}E= defined $re->{"transform_options"}F= length $re->{"transform_options"}
ABCDEFresult
111XXX1
0XX1111
10X1111
1101111
0XX0XX0
0XX10X0
0XX1100
10X0XX0
10X10X0
10X1100
1100XX0
11010X0
1101100
1415 defined( $re->{ext_transform} ) &&
1416 length( $re->{ext_transform} ) ) ||
1417 ( exists( $re->{transform_options} ) &&
1418 defined( $re->{transform_options} ) &&
1419 length( $re->{transform_options} ) ) )
1420 {
1421 16 my $t;
1422 16 ▶ if( exists( $re->{ext_transform} ) &&
Branch: 2 branches
BranchTrueFalseTotal
if (exists $re->{'ext_transform'} and defined $re->{'ext_transform'}) { } 16 0 16
elsif (exists $re->{'transform_options'} and defined $re->{'transform_options'}) { } 0 0 0
Condition33%1/3
exists $re->{"ext_transform"} and defined $re->{"ext_transform"}
!ll&&!rl&&r
0016
MC/DC0%0/2
exists $re->{"ext_transform"} and defined $re->{"ext_transform"}
exists $re->{"ext_transform"} defined $re->{"ext_transform"}
Truth table33%1/3
A and B
A= exists $re->{"ext_transform"}B= defined $re->{"ext_transform"}
ABresult
0X0
100
111
1423 defined( $re->{ext_transform} ) )
1424 {
1425 16 ▶ my $t_locale = $self->new( $re->{ext_transform_locale} ) ||
Condition50%1/2
$self->new($re->{'ext_transform_locale'}) || (return $self->pass_error)
l!l
160
MC/DC0%0/1
$self->new($re->{'ext_transform_locale'}) || (return $self->pass_error)
$self->new($re->{'ext_transform_locale'})
Truth table50%1/2
A
A= $self->new($re->{'ext_transform_locale'})
Aresult
11
00
1426 return( $self->pass_error );
1427 16 $info->{transform_locale} = $t_locale;
1428 16 $t = $re->{ext_transform};
1429 16 my $offset = length( "t-${t_locale}" );
1430 16 ▶ if( length( $re->{ext_transform} ) > $offset &&
Branch: 1 branch
BranchTrueFalseTotal
if (length $re->{"ext_transform"} > $offset and substr($re->{"ext_transform"}, $offset, 1) eq "-") 10 6 16
Condition66%2/3
length $re->{"ext_transform"} > $offset and substr($re->{"ext_transform"}, $offset, 1) eq "-"
!ll&&!rl&&r
6010
MC/DC50%1/2
length $re->{"ext_transform"} > $offset and substr($re->{"ext_transform"}, $offset, 1) eq "-"
length $re->{"ext_transform"} > $offset substr($re->{"ext_transform"}, $offset, 1) eq "-"
Truth table66%2/3
A and B
A= length $re->{"ext_transform"} > $offsetB= substr($re->{"ext_transform"}, $offset, 1) eq "-"
ABresult
0X0
100
111
1431 substr( $re->{ext_transform}, $offset, 1 ) eq '-' )
1432 {
1433 10 $offset++;
1434 }
1435 16 substr( $t, 0, $offset, '' );
1436 }
1437 ▶ elsif( exists( $re->{transform_options} ) &&
Condition0%0/3
exists $re->{"transform_options"} and defined $re->{"transform_options"}
!ll&&!rl&&r
000
MC/DC0%0/2
exists $re->{"transform_options"} and defined $re->{"transform_options"}
exists $re->{"transform_options"} defined $re->{"transform_options"}
Truth table0%0/3
A and B
A= exists $re->{"transform_options"}B= defined $re->{"transform_options"}
ABresult
0X0
100
111
1438 defined( $re->{transform_options} ) )
1439 {
1440 0 $t = $re->{transform_options};
1441 }
1442 16 $info->{transform_ext} = [];
1443 16 my @parts = split( /\-?($LOCALE_TRANSFORM_PARAMETERS_RE)\-/, $t );
1444 # First array element is undef, because it is the beginning of the string.
1445 16 shift( @parts );
1446 16 ▶ for( my $i = 0; $i < scalar( @parts ); $i += 2 )
Branch: 1 branch
BranchTrueFalseTotal
if ($i < scalar @parts) 15 16 31
1447 {
1448 15 my $n = $parts[$i];
1449 15 my $v = $parts[$i + 1];
1450 15 ▶ if( exists( $info->{ $n } ) )
Branch: 2 branches
BranchTrueFalseTotal
if (exists $info->{$n}) { } 0 15 15
elsif (not $self->can($n)) { } 0 15 15
1451 {
1452 0 ▶ warn( "The Transform extension \"${n}\" was previously defined with \"", ( $info->{ $n } // 'undef' ), "\", overwriting it with \"", ( $v // 'undef' ), "\"" ) if( warnings::enabled() );
Branch: 1 branch
BranchTrueFalseTotal
if warnings::enabled() 0 0 0
Condition0%0/4
$info->{$n} // "undef"
l!l
00
$v // "undef"
l!l
00
MC/DC0%0/1
$info->{$n} // "undef"
$info->{$n}
MC/DC0%0/1
$v // "undef"
$v
Truth table0%0/2
A
A= $info->{$n}
Aresult
11
00
Truth table0%0/2
A
A= $v
Aresult
11
00
1453 }
1454 elsif( !$self->can( $n ) )
1455 {
1456 0 ▶ warn( "The Transform extension specified \"${n}\" is unsupported." ) if( warnings::enabled() );
Branch: 1 branch
BranchTrueFalseTotal
if warnings::enabled() 0 0 0
1457 }
1458 15 $info->{ $n } = $v;
1459 15 push( @{$info->{transform_ext}}, $n );
1460 }
1461 }
1462  
1463 103 ▶ if( ( exists( $re->{ext_unicode} ) &&
Branch: 1 branch
BranchTrueFalseTotal
if (exists $re->{"ext_unicode"} and defined $re->{"ext_unicode"} and length $re->{"ext_unicode"} or exists $re->{"collation_options"} and defined $re->{"collation_options"} and length $re->{"collation_options"}) 9 94 103
Condition53%8/15
exists $re->{"ext_unicode"} and defined $re->{"ext_unicode"} and length $re->{"ext_unicode"} or exists $re->{"collation_options"} and defined $re->{"collation_options"} and length $re->{"collation_options"}
l!l&&r!l&&!r
9094
exists $re->{"ext_unicode"} and defined $re->{"ext_unicode"} and length $re->{"ext_unicode"}
!ll&&!rl&&r
9409
exists $re->{"ext_unicode"} and defined $re->{"ext_unicode"}
!ll&&!rl&&r
9409
exists $re->{"collation_options"} and defined $re->{"collation_options"} and length $re->{"collation_options"}
!ll&&!rl&&r
9400
exists $re->{"collation_options"} and defined $re->{"collation_options"}
!ll&&!rl&&r
9400
MC/DC16%1/6
exists $re->{"ext_unicode"} and defined $re->{"ext_unicode"} and length $re->{"ext_unicode"} or exists $re->{"collation_options"} and defined $re->{"collation_options"} and length $re->{"collation_options"}
exists $re->{"ext_unicode"} defined $re->{"ext_unicode"} length $re->{"ext_unicode"} exists $re->{"collation_options"} defined $re->{"collation_options"} length $re->{"collation_options"}
Truth table15%2/13
A and B and C or D and E and F
A= exists $re->{"ext_unicode"}B= defined $re->{"ext_unicode"}C= length $re->{"ext_unicode"}D= exists $re->{"collation_options"}E= defined $re->{"collation_options"}F= length $re->{"collation_options"}
ABCDEFresult
111XXX1
0XX1111
10X1111
1101111
0XX0XX0
0XX10X0
0XX1100
10X0XX0
10X10X0
10X1100
1100XX0
11010X0
1101100
1464 defined( $re->{ext_unicode} ) &&
1465 length( $re->{ext_unicode} ) ) ||
1466 ( exists( $re->{collation_options} ) &&
1467 defined( $re->{collation_options} ) &&
1468 length( $re->{collation_options} ) ) )
1469 {
1470 9 $info->{unicode_ext} = [];
1471 # ca, co, cf, cu, etc... or collation options such as: ka, kb, kc, etc.
1472 # my @parts = split( /\-([a-z]{2})\-/, '-' . ( $re->{ext_unicode_subtag} // $re->{collation_options} ) );
1473 9 ▶ substr( $re->{ext_unicode}, 0, 1, '' ) if( substr( $re->{ext_unicode}, 0, 2 ) eq 'u-' );
Branch: 1 branch
BranchTrueFalseTotal
if substr($re->{"ext_unicode"}, 0, 2) eq "u-" 9 0 9
1474 9 ▶ my @parts = split( /\-([a-z]{2})\-/, ( $re->{ext_unicode} // ( '-' . $re->{collation_options} ) ) );
Condition50%1/2
$re->{"ext_unicode"} // '-' . $re->{"collation_options"}
l!l
90
MC/DC0%0/1
$re->{"ext_unicode"} // '-' . $re->{"collation_options"}
$re->{"ext_unicode"}
Truth table50%1/2
A
A= $re->{"ext_unicode"}
Aresult
11
00
1475 9 shift( @parts );
1476 9 ▶ for( my $i = 0; $i < scalar( @parts ); $i += 2 )
Branch: 1 branch
BranchTrueFalseTotal
if ($i < scalar @parts) 17 9 26
1477 {
1478 17 my $n = $parts[$i];
1479 17 my $v = $parts[$i + 1];
1480 17 ▶ if( exists( $info->{ $n } ) )
Branch: 2 branches
BranchTrueFalseTotal
if (exists $info->{$n}) { } 0 17 17
elsif (not $self->can($n)) { } 0 17 17
1481 {
1482 0 ▶ warn( "The Unicode extension \"${n}\" was previously defined with \"", ( $info->{ $n } // 'undef' ), "\", overwriting it with \"", ( $v // 'undef' ), "\"" ) if( warnings::enabled() );
Branch: 1 branch
BranchTrueFalseTotal
if warnings::enabled() 0 0 0
Condition0%0/4
$info->{$n} // "undef"
l!l
00
$v // "undef"
l!l
00
MC/DC0%0/1
$info->{$n} // "undef"
$info->{$n}
MC/DC0%0/1
$v // "undef"
$v
Truth table0%0/2
A
A= $info->{$n}
Aresult
11
00
Truth table0%0/2
A
A= $v
Aresult
11
00
1483 }
1484 elsif( !$self->can( $n ) )
1485 {
1486 0 ▶ warn( "The Unicode extension specified \"${n}\" is unsupported." ) if( warnings::enabled() );
Branch: 1 branch
BranchTrueFalseTotal
if warnings::enabled() 0 0 0
1487 }
1488 17 $info->{ $n } = $v;
1489 17 push( @{$info->{unicode_ext}}, $n );
1490 }
1491 }
1492  
1493 103 ▶ if( exists( $re->{extension} ) &&
Branch: 1 branch
BranchTrueFalseTotal
if (exists $re->{"extension"} and defined $re->{"extension"} and length $re->{"extension"}) 0 103 103
Condition33%2/6
exists $re->{"extension"} and defined $re->{"extension"} and length $re->{"extension"}
!ll&&!rl&&r
10300
exists $re->{"extension"} and defined $re->{"extension"}
!ll&&!rl&&r
10300
MC/DC0%0/3
exists $re->{"extension"} and defined $re->{"extension"} and length $re->{"extension"}
exists $re->{"extension"} defined $re->{"extension"} length $re->{"extension"}
Truth table25%1/4
A and B and C
A= exists $re->{"extension"}B= defined $re->{"extension"}C= length $re->{"extension"}
ABCresult
0XX0
10X0
1100
1111
1494 defined( $re->{extension} ) &&
1495 length( $re->{extension} ) )
1496 {
1497 0 my $tag = $re->{singleton};
1498 $info->{singleton} =
1499 {
1500 0 $tag => {},
1501 };
1502 0 $info->{singleton}->{ $tag }->{subtags} = [];
1503 0 my @parts = split( /\-([a-zA-Z0-9]{2,8})\-/, $re->{subtag} );
1504 0 ▶ for( my $i = 0; $i < scalar( @parts ); $i += 2 )
Branch: 1 branch
BranchTrueFalseTotal
if ($i < scalar @parts) 0 0 0
1505 {
1506 0 my $n = $parts[$i];
1507 0 my $v = $parts[$i + 1];
1508 0 $info->{singleton}->{ $tag }->{ $n } = $v;
1509 0 push( @{$info->{singleton}->{ $tag }->{subtags}}, $n );
1510 }
1511 }
1512  
1513 103 ▶ if( exists( $re->{private_extension} ) &&
Branch: 1 branch
BranchTrueFalseTotal
if (exists $re->{"private_extension"} and defined $re->{"private_extension"} and length $re->{"private_extension"}) 4 99 103
Condition66%4/6
exists $re->{"private_extension"} and defined $re->{"private_extension"} and length $re->{"private_extension"}
!ll&&!rl&&r
9904
exists $re->{"private_extension"} and defined $re->{"private_extension"}
!ll&&!rl&&r
9904
MC/DC33%1/3
exists $re->{"private_extension"} and defined $re->{"private_extension"} and length $re->{"private_extension"}
exists $re->{"private_extension"} defined $re->{"private_extension"} length $re->{"private_extension"}
Truth table50%2/4
A and B and C
A= exists $re->{"private_extension"}B= defined $re->{"private_extension"}C= length $re->{"private_extension"}
ABCresult
0XX0
10X0
1100
1111
1514 defined( $re->{private_extension} ) &&
1515 length( $re->{private_extension} ) )
1516 {
1517 4 $info->{private} = $re->{private_subtag};
1518 }
1519 103 return( $info );
1520 }
1521  
1522 sub pass_error
1523 0 ▶{
Subroutine pass_error: not called CC=37 SCAR=71.8
Pod undocumented
1524 0 my $self = shift( @_ );
1525 0 ▶ my $pack = ref( $self ) || $self;
Condition0%0/3
ref $self || $self
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $self || $self
ref $self $self
Truth table0%0/3
A || B
A= ref $selfB= $self
ABresult
1X1
011
000
1526 0 my $opts = {};
1527 0 my( $err, $class, $code );
1528 3 ▶ no strict 'refs';
Subroutine BEGIN: called CC=1 SCAR=0.0
1529 0 ▶ if( scalar( @_ ) )
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @_) 0 0 0
1530 {
1531 # Either an hash defining a new error and this will be passed along to error(); or
1532 # an hash with a single property: { class => 'Some::ExceptionClass' }
1533 0 ▶ if( scalar( @_ ) == 1 && ref( $_[0] ) eq 'HASH' )
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @_ == 1 and ref $_[0] eq 'HASH') { } 0 0 0
Condition0%0/3
scalar @_ == 1 and ref $_[0] eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/2
scalar @_ == 1 and ref $_[0] eq "HASH"
scalar @_ == 1 ref $_[0] eq "HASH"
Truth table0%0/3
A and B
A= scalar @_ == 1B= ref $_[0] eq "HASH"
ABresult
0X0
100
111
1534 {
1535 0 $opts = $_[0];
1536 }
1537 else
1538 {
1539 0 ▶ if( scalar( @_ ) > 1 && ref( $_[-1] ) eq 'HASH' )
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @_ > 1 and ref $_[-1] eq "HASH") 0 0 0
Condition0%0/3
scalar @_ > 1 and ref $_[-1] eq "HASH"
!ll&&!rl&&r
000
MC/DC0%0/2
scalar @_ > 1 and ref $_[-1] eq "HASH"
scalar @_ > 1 ref $_[-1] eq "HASH"
Truth table0%0/3
A and B
A= scalar @_ > 1B= ref $_[-1] eq "HASH"
ABresult
0X0
100
111
1540 {
1541 0 $opts = pop( @_ );
1542 }
1543 0 $err = $_[0];
1544 }
1545 }
1546 0 ▶ $err = $opts->{error} if( !defined( $err ) && CORE::exists( $opts->{error} ) && defined( $opts->{error} ) && CORE::length( $opts->{error} ) );
Branch: 1 branch
BranchTrueFalseTotal
if not defined $err and exists $opts->{"error"} and defined $opts->{"error"} and length $opts->{"error"} 0 0 0
Condition0%0/9
not defined $err and exists $opts->{"error"} and defined $opts->{"error"} and length $opts->{"error"}
!ll&&!rl&&r
000
not defined $err and exists $opts->{"error"} and defined $opts->{"error"}
!ll&&!rl&&r
000
not defined $err and exists $opts->{"error"}
!ll&&!rl&&r
000
MC/DC0%0/4
not defined $err and exists $opts->{"error"} and defined $opts->{"error"} and length $opts->{"error"}
not defined $err exists $opts->{"error"} defined $opts->{"error"} length $opts->{"error"}
Truth table0%0/5
not(A) and B and C and D
A= not defined $errB= exists $opts->{"error"}C= defined $opts->{"error"}D= length $opts->{"error"}
ABCDresult
0XXX0
10XX0
110X0
11100
11111
1547 # We set $class only if the hash provided is a one-element hash and not an error-defining hash
1548 0 ▶ $class = $opts->{class} if( CORE::exists( $opts->{class} ) && defined( $opts->{class} ) && CORE::length( $opts->{class} ) );
Branch: 1 branch
BranchTrueFalseTotal
if exists $opts->{"class"} and defined $opts->{"class"} and length $opts->{"class"} 0 0 0
Condition0%0/6
exists $opts->{"class"} and defined $opts->{"class"} and length $opts->{"class"}
!ll&&!rl&&r
000
exists $opts->{"class"} and defined $opts->{"class"}
!ll&&!rl&&r
000
MC/DC0%0/3
exists $opts->{"class"} and defined $opts->{"class"} and length $opts->{"class"}
exists $opts->{"class"} defined $opts->{"class"} length $opts->{"class"}
Truth table0%0/4
A and B and C
A= exists $opts->{"class"}B= defined $opts->{"class"}C= length $opts->{"class"}
ABCresult
0XX0
10X0
1100
1111
1549 0 ▶ $code = $opts->{code} if( CORE::exists( $opts->{code} ) && defined( $opts->{code} ) && CORE::length( $opts->{code} ) );
Branch: 1 branch
BranchTrueFalseTotal
if exists $opts->{"code"} and defined $opts->{"code"} and length $opts->{"code"} 0 0 0
Condition0%0/6
exists $opts->{"code"} and defined $opts->{"code"} and length $opts->{"code"}
!ll&&!rl&&r
000
exists $opts->{"code"} and defined $opts->{"code"}
!ll&&!rl&&r
000
MC/DC0%0/3
exists $opts->{"code"} and defined $opts->{"code"} and length $opts->{"code"}
exists $opts->{"code"} defined $opts->{"code"} length $opts->{"code"}
Truth table0%0/4
A and B and C
A= exists $opts->{"code"}B= defined $opts->{"code"}C= length $opts->{"code"}
ABCresult
0XX0
10X0
1100
1111
1550
1551 # called with no argument, most likely from the same class to pass on an error
1552 # set up earlier by another method; or
1553 # with an hash containing just one argument class => 'Some::ExceptionClass'
1554 0 ▶ if( !defined( $err ) && ( !scalar( @_ ) || defined( $class ) ) )
Branch: 2 branches
BranchTrueFalseTotal
if (not defined $err and !scalar(@_) || defined $class) { } 0 0 0
elsif (defined $err and builtin::blessed($err) and scalar @_ == 1 || scalar @_ == 2 && defined $class) { } 0 0 0
Condition0%0/6
not defined $err and !scalar(@_) || defined $class
!ll&&!rl&&r
000
not scalar @_ or defined $class
l!l&&r!l&&!r
000
MC/DC0%0/3
not defined $err and !scalar(@_) || defined $class
not defined $err not scalar @_ defined $class
Truth table0%0/4
not(A) and not(B) or C
A= not defined $errB= not scalar @_C= defined $class
ABCresult
0XX0
1000
11X1
1011
1555 {
1556 # $error is a previous erro robject
1557 0 ▶ my $error = ref( $self ) ? $self->{error} : length( ${ $pack . '::ERROR' } ) ? ${ $pack . '::ERROR' } : undef;
Branch: 2 branches
BranchTrueFalseTotal
ref $self ? : 0 0 0
length ${$pack . '::ERROR';} ? : 0 0 0
1558 0 ▶ if( !defined( $error ) )
Branch: 1 branch
BranchTrueFalseTotal
if (not defined $error) { } 0 0 0
1559 {
1560 0 warn( "No error object provided and no previous error set either! It seems the previous method call returned a simple undef" );
1561 }
1562 else
1563 {
1564 0 ▶ $err = ( defined( $class ) ? bless( $error => $class ) : $error );
Branch: 1 branch
BranchTrueFalseTotal
defined $class ? : 0 0 0
1565 0 ▶ $err->code( $code ) if( defined( $code ) );
Branch: 1 branch
BranchTrueFalseTotal
if defined $code 0 0 0
1566 }
1567 }
1568 ▶ elsif( defined( $err ) &&
Condition0%0/12
defined $err and builtin::blessed($err) and scalar @_ == 1 || scalar @_ == 2 && defined $class
!ll&&!rl&&r
000
defined $err and builtin::blessed($err)
!ll&&!rl&&r
000
scalar @_ == 1 or scalar @_ == 2 and defined $class
l!l&&r!l&&!r
000
scalar @_ == 2 and defined $class
!ll&&!rl&&r
000
MC/DC0%0/5
defined $err and builtin::blessed($err) and scalar @_ == 1 || scalar @_ == 2 && defined $class
defined $err builtin::blessed($err) scalar @_ == 1 scalar @_ == 2 defined $class
Truth table0%0/6
A and B and C or D and E
A= defined $errB= builtin::blessed($err)C= scalar @_ == 1D= scalar @_ == 2E= defined $class
ABCDEresult
0XXXX0
10XXX0
1100X0
110100
111XX1
110111
1569 Scalar::Util::blessed( $err ) &&
1570 ( scalar( @_ ) == 1 ||
1571 ( scalar( @_ ) == 2 && defined( $class ) )
1572 ) )
1573 {
1574 0 ▶ $self->{error} = ${ $pack . '::ERROR' } = ( defined( $class ) ? bless( $err => $class ) : $err );
Branch: 1 branch
BranchTrueFalseTotal
defined $class ? : 0 0 0
1575 0 ▶ $self->{error}->code( $code ) if( defined( $code ) && $self->{error}->can( 'code' ) );
Branch: 1 branch
BranchTrueFalseTotal
if defined $code and $self->{"error"}->can("code") 0 0 0
Condition0%0/3
defined $code and $self->{"error"}->can("code")
!ll&&!rl&&r
000
MC/DC0%0/2
defined $code and $self->{"error"}->can("code")
defined $code $self->{"error"}->can("code")
Truth table0%0/3
A and B
A= defined $codeB= $self->{"error"}->can("code")
ABresult
0X0
100
111
1576
1577 0 ▶ if( $self->{fatal} || ( defined( ${"${class}\::FATAL_EXCEPTIONS"} ) && ${"${class}\::FATAL_EXCEPTIONS"} ) )
Branch: 1 branch
BranchTrueFalseTotal
if ($self->{"fatal"} or defined ${"${class}::FATAL_EXCEPTIONS";} and ${"${class}::FATAL_EXCEPTIONS";}) 0 0 0
Condition0%0/6
$self->{"fatal"} or defined ${"${class}::FATAL_EXCEPTIONS";} and ${"${class}::FATAL_EXCEPTIONS";}
l!l&&r!l&&!r
000
defined ${"${class}::FATAL_EXCEPTIONS";} and ${"${class}::FATAL_EXCEPTIONS";}
!ll&&!rl&&r
000
MC/DC0%0/3
$self->{"fatal"} or defined ${"${class}::FATAL_EXCEPTIONS";} and ${"${class}::FATAL_EXCEPTIONS";}
$self->{"fatal"} defined ${"${class}::FATAL_EXCEPTIONS";} ${"${class}::FATAL_EXCEPTIONS";}
Truth table0%0/4
A or B and C
A= $self->{"fatal"}B= defined ${"${class}::FATAL_EXCEPTIONS";}C= ${"${class}::FATAL_EXCEPTIONS";}
ABCresult
1XX1
0111
00X0
0100
1578 {
1579 0 die( $self->{error} );
1580 }
1581 }
1582 # If the error provided is not an object, we call error to create one
1583 else
1584 {
1585 0 return( $self->error( @_ ) );
1586 }
1587
1588 0 ▶ if( want( 'OBJECT' ) )
Branch: 1 branch
BranchTrueFalseTotal
if (want("OBJECT")) 0 0 0
1589 {
1590 0 rreturn( Locale::Unicode::NullObject->new );
1591 }
1592 0 return;
1593 }
1594  
1595 # x-something
1596 52 ▶sub private { return( shift->reset(@_)->_set_get_prop( 'private', @_ ) ); }
Subroutine private: called CC=1 SCAR=0.0
Pod documented
1597  
1598 93 ▶sub privateuse { return( shift->reset(@_)->_set_get_prop( {
Subroutine privateuse: called CC=1 SCAR=0.0
Pod documented
1599 field => 'privateuse',
1600 on_update => sub
1601 2 ▶ {
Subroutine __ANON__: called CC=1 SCAR=0.0
1602 2 $_[0]->{language} = undef;
1603 2 $_[0]->{language3} = undef;
1604 2 $_[0]->{grandfathered_irregular} = undef;
1605 2 $_[0]->{grandfathered_regular} = undef;
1606 },
1607 93 }, @_ ) ); }
1608  
1609 35 ▶sub region { return( shift->reset(@_)->_set_get_prop({
Subroutine region: called CC=1 SCAR=1.2
Pod documented
1610 field => 'region',
1611 0 ▶ on_update => sub{ $_[0]->{country_code} = undef; },
Subroutine __ANON__: not called CC=1 SCAR=6.9
1612 35 }, @_ ) ); }
1613  
1614 # u-rg
1615 48 ▶sub region_override { return( shift->reset(@_)->_set_get_prop( 'region_override', @_ ) ); }
Subroutine region_override: called CC=1 SCAR=0.0
Pod documented
1616  
1617 # u-rg
1618 0 ▶sub rg { return( shift->region_override( @_ ) ); }
Subroutine rg: not called CC=1 SCAR=6.9
Pod documented
1619  
1620 sub reset
1621 2731 ▶{
Subroutine reset: called CC=4 SCAR=13.9
Pod documented
1622 2731 my $self = shift( @_ );
1623 2731 ▶ if( !CORE::length( $self->{_reset} // '' ) && scalar( @_ ) )
Branch: 1 branch
BranchTrueFalseTotal
if (not length($self->{"_reset"} // "") and scalar @_) 88 2643 2731
Condition100%4/4
not length($self->{"_reset"} // "") and scalar @_
!ll
2521210
$self->{"_reset"} // ""
l!l
2521210
MC/DC100%1/1
not length($self->{"_reset"} // "") and scalar @_
$self->{"_reset"}
Truth table100%2/2
not(A)
A= $self->{"_reset"}
Aresult
10
01
1624 {
1625 88 $self->{_reset} = scalar( @_ );
1626 }
1627 2731 return( $self );
1628 }
1629  
1630 # t-s0
1631 0 ▶sub s0 { return( shift->source( @_ ) ); }
Subroutine s0: not called CC=1 SCAR=6.9
Pod documented
1632  
1633 94 ▶sub script { return( shift->reset(@_)->_set_get_prop( 'script', @_ ) ); }
Subroutine script: called CC=1 SCAR=0.0
Pod documented
1634  
1635 # u-ss
1636 48 ▶sub sentence_break { return( shift->reset(@_)->_set_get_prop( 'sentence_break', @_ ) ); }
Subroutine sentence_break: called CC=1 SCAR=0.0
Pod documented
1637  
1638 # u-kv
1639 0 ▶sub shiftedGroup { return( shift->colValue( @_ ) ); }
Subroutine shiftedGroup: not called CC=1 SCAR=6.9
Pod documented
1640  
1641 # t-s0
1642 48 ▶sub source { return( shift->reset(@_)->_set_get_prop( 'source', @_ ) ); }
Subroutine source: called CC=1 SCAR=0.0
Pod documented
1643  
1644 # u-sd
1645 50 ▶sub sd { return( shift->subdivision( @_ ) ); }
Subroutine sd: called CC=1 SCAR=0.0
Pod documented
1646  
1647 # u-ss
1648 0 ▶sub ss { return( shift->sentence_break( @_ ) ); }
Subroutine ss: not called CC=1 SCAR=6.9
Pod documented
1649  
1650 # u-sd
1651 50 ▶sub subdivision { return( shift->reset(@_)->_set_get_prop( 'subdivision', @_ ) ); }
Subroutine subdivision: called CC=1 SCAR=0.0
Pod documented
1652  
1653 # t-t0
1654 3 ▶sub t0 { return( shift->translation( @_ ) ); }
Subroutine t0: called CC=1 SCAR=0.0
Pod documented
1655  
1656 # t-x0
1657 53 ▶sub t_private { return( shift->reset(@_)->_set_get_prop( 't_private', @_ ) ); }
Subroutine t_private: called CC=1 SCAR=0.0
Pod documented
1658  
1659 sub territory
1660 11 ▶{
Subroutine territory: called CC=6 SCAR=21.4
Pod documented
1661 11 my $self = shift( @_ );
1662 11 ▶ if( @_ )
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 2 9 11
1663 {
1664 2 my $val = shift( @_ );
1665 2 ▶ if( defined( $val ) )
Branch: 1 branch
BranchTrueFalseTotal
if (defined $val) { } 2 0 2
1666 {
1667 2 ▶ if( $val =~ /^([a-zA-Z]{2})$/ )
Branch: 2 branches
BranchTrueFalseTotal
if ($val =~ /^([a-zA-Z]{2})$/) { } 2 0 2
elsif ($val =~ /^(\d{3})$/) { } 0 0 0
1668 {
1669 2 $self->country_code( uc( $1 ) );
1670 }
1671 elsif( $val =~ /^(\d{3})$/ )
1672 {
1673 0 $self->region( $1 );
1674 }
1675 else
1676 {
1677 0 return( $self->error( "Invalid value for territory. It must be either a 2-characters ISO3166 code or a 3-digits region code." ) );
1678 }
1679 }
1680 else
1681 {
1682 0 $self->country_code( undef );
1683 0 $self->region( undef );
1684 }
1685 }
1686 11 ▶ return( $self->country_code || $self->region );
Condition66%2/3
$self->country_code || $self->region
l!l&&r!l&&!r
803
MC/DC50%1/2
$self->country_code || $self->region
$self->country_code $self->region
Truth table66%2/3
A || B
A= $self->country_codeB= $self->region
ABresult
1X1
011
000
1687 }
1688  
1689 # u-tz
1690 54 ▶sub time_zone { return( shift->reset(@_)->_set_get_prop( 'time_zone', @_ ) ); }
Subroutine time_zone: called CC=1 SCAR=0.0
Pod documented
1691  
1692 # u-tz
1693 0 ▶sub timezone { return( shift->reset(@_)->_set_get_prop( 'time_zone', @_ ) ); }
Subroutine timezone: not called CC=1 SCAR=6.9
Pod documented
1694  
1695 sub transform
1696 5 ▶{
Subroutine transform: called CC=8 SCAR=21.6
Pod documented
1697 5 my $self = shift( @_ );
1698 5 ▶ if( @_ )
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 3 2 5
1699 {
1700 3 my $val = shift( @_ );
1701 3 ▶ if( defined( $val ) )
Branch: 1 branch
BranchTrueFalseTotal
if (defined $val) 3 0 3
1702 {
1703 3 ▶ unless( Scalar::Util::blessed( $val ) &&
Branch: 1 branch
BranchTrueFalseTotal
unless (builtin::blessed($val) and $val->isa(ref $self || $self)) 2 1 3
Condition50%3/6
builtin::blessed($val) and $val->isa(ref $self || $self)
!ll&&!rl&&r
201
ref $self || $self
l!l&&r!l&&!r
100
MC/DC50%1/2
builtin::blessed($val) and $val->isa(ref $self || $self)
builtin::blessed($val) $val->isa(ref $self || $self)
MC/DC0%0/2
ref $self || $self
ref $self $self
Truth table66%2/3
A and B
A= builtin::blessed($val)B= $val->isa(ref $self || $self)
ABresult
0X0
100
111
Truth table33%1/3
A || B
A= ref $selfB= $self
ABresult
1X1
011
000
1704 $val->isa( ref( $self ) || $self ) )
1705 {
1706 2 ▶ my $locale = $self->new( $val ) || return( $self->pass_error );
Condition50%1/2
$self->new($val) || (return $self->pass_error)
l!l
20
MC/DC0%0/1
$self->new($val) || (return $self->pass_error)
$self->new($val)
Truth table50%1/2
A
A= $self->new($val)
Aresult
11
00
1707 2 my $core = $locale->core;
1708 2 ▶ $locale = $self->new( $core ) unless( $core eq $locale );
Branch: 1 branch
BranchTrueFalseTotal
unless $core eq $locale 0 2 2
1709 2 $val = $locale;
1710 }
1711 }
1712 3 $self->transform_locale( $val );
1713 }
1714 5 return( $self );
1715 }
1716  
1717 # t-und-Latn
1718 68 ▶sub transform_locale { return( shift->reset(@_)->_set_get_prop({
Subroutine transform_locale: called CC=1 SCAR=0.0
Pod documented
1719 field => 'transform_locale',
1720 isa => 'Locale::Unicode',
1721 }, @_ ) ); }
1722  
1723 # t-t0
1724 56 ▶sub translation { return( shift->reset(@_)->_set_get_prop( 'translation', @_ ) ); }
Subroutine translation: called CC=1 SCAR=0.0
Pod documented
1725  
1726 0 ▶sub true { return( $Locale::Unicode::Boolean::true ); }
Subroutine true: not called CC=1 SCAR=6.9
Pod documented
1727  
1728 # u-tz
1729 4 ▶sub tz { return( shift->time_zone( @_ ) ); }
Subroutine tz: called CC=1 SCAR=0.0
Pod documented
1730  
1731 # Returns an Olson IANA time zone name as a string for a given CLDR timezone ID
1732 sub tz_id2name
1733 1 ▶{
Subroutine tz_id2name: called CC=6 SCAR=21.4
Pod documented
1734 1 my $self = shift( @_ );
1735 1 ▶ my $id = shift( @_ ) || return( $self->error( "No CLDR timezone ID was provided." ) );
Condition50%1/2
shift @_ || (return $self->error('No CLDR timezone ID was provided.'))
l!l
10
MC/DC0%0/1
shift @_ || (return $self->error('No CLDR timezone ID was provided.'))
shift @_
Truth table50%1/2
A
A= shift @_
Aresult
11
00
1736 1 ▶ my $def = $self->tz_info( $id ) || return( '' );
Condition50%1/2
$self->tz_info($id) || (return '')
l!l
10
MC/DC0%0/1
$self->tz_info($id) || (return '')
$self->tz_info($id)
Truth table50%1/2
A
A= $self->tz_info($id)
Aresult
11
00
1737 1 ▶ if( !defined( $def->{tz} ) ||
Branch: 1 branch
BranchTrueFalseTotal
unless (defined $def->{"tz"} and length($def->{"tz"} // "")) 0 1 1
Condition40%2/5
defined $def->{"tz"} and length($def->{"tz"} // "")
!ll&&!rl&&r
001
$def->{"tz"} // ""
l!l
10
MC/DC0%0/2
defined $def->{"tz"} and length($def->{"tz"} // "")
defined $def->{"tz"} $def->{"tz"}
Truth table33%1/3
A and B
A= defined $def->{"tz"}B= $def->{"tz"}
ABresult
0X0
100
111
1738 !length( $def->{tz} // '' ) )
1739 {
1740 0 return( $self->error( "No property 'tz' could be found in our database for CLDR timezone ID '$id'. It seems our database is corrupted." ) );
1741 }
1742 1 return( $def->{tz} );
1743 }
1744  
1745 # Returns an array object of Olson IANA time zones for a given CLDR timezone ID
1746 sub tz_id2names
1747 1 ▶{
Subroutine tz_id2names: called CC=7 SCAR=23.0
Pod documented
1748 1 my $self = shift( @_ );
1749 1 ▶ my $id = shift( @_ ) || return( $self->error( "No CLDR timezone ID was provided." ) );
Condition50%1/2
shift @_ || (return $self->error('No CLDR timezone ID was provided.'))
l!l
10
MC/DC0%0/1
shift @_ || (return $self->error('No CLDR timezone ID was provided.'))
shift @_
Truth table50%1/2
A
A= shift @_
Aresult
11
00
1750 1 my $a = [];
1751 1 my $def = $self->tz_info( $id );
1752 1 ▶ if( !defined( $def ) )
Branch: 2 branches
BranchTrueFalseTotal
if (not defined $def) { } 0 1 1
elsif (not $def) { } 0 1 1
1753 {
1754 0 return( $self->pass_error );
1755 }
1756 elsif( !$def )
1757 {
1758 0 return( $a );
1759 }
1760 1 ▶ push( @$a, @{$def->{alias}} ) if( exists( $def->{alias} ) && ( ref( $def->{alias} ) || '' ) eq 'ARRAY' );
Branch: 1 branch
BranchTrueFalseTotal
if exists $def->{"alias"} and (ref $def->{"alias"} || "") eq "ARRAY" 1 0 1
Condition40%2/5
exists $def->{"alias"} and (ref $def->{"alias"} || "") eq "ARRAY"
!ll&&!rl&&r
001
ref $def->{'alias'} || ''
l!l
10
MC/DC0%0/2
exists $def->{"alias"} and (ref $def->{"alias"} || "") eq "ARRAY"
exists $def->{"alias"} ref $def->{'alias'}
Truth table33%1/3
A and B
A= exists $def->{"alias"}B= ref $def->{'alias'}
ABresult
0X0
100
111
1761 1 return( $a );
1762 }
1763  
1764 sub tz_info
1765 3 ▶{
Subroutine tz_info: called CC=3 SCAR=11.2
Pod documented
1766 3 my $self = shift( @_ );
1767 3 ▶ my $id = shift( @_ ) || return( $self->error( "No CLDR timezone ID was provided." ) );
Condition50%1/2
shift @_ || (return $self->error('No CLDR timezone ID was provided.'))
l!l
30
MC/DC0%0/1
shift @_ || (return $self->error('No CLDR timezone ID was provided.'))
shift @_
Truth table50%1/2
A
A= shift @_
Aresult
11
00
1768 3 $id = lc( $id );
1769 3 ▶ return( '' ) if( !exists( $TZ_DICT->{ $id } ) );
Branch: 1 branch
BranchTrueFalseTotal
unless exists $Locale::Unicode::TZ_DICT->{$id} 0 3 3
1770 3 my %ref = %{$TZ_DICT->{ $id }};
1771 3 return( \%ref );
1772 }
1773  
1774 # Returns a CLDR timezone ID for a given IANA Olson timezone name
1775 sub tz_name2id
1776 1 ▶{
Subroutine tz_name2id: called CC=6 SCAR=22.8
Pod documented
1777 1 my $self = shift( @_ );
1778 1 ▶ my $name = shift( @_ ) || return( $self->error( "No CLDR timezone ID was provided." ) );
Condition50%1/2
shift @_ || (return $self->error('No CLDR timezone ID was provided.'))
l!l
10
MC/DC0%0/1
shift @_ || (return $self->error('No CLDR timezone ID was provided.'))
shift @_
Truth table50%1/2
A
A= shift @_
Aresult
11
00
1779 1 ▶ if( !exists( $TZ_NAME2ID->{ $name } ) ||
Branch: 1 branch
BranchTrueFalseTotal
unless (exists $Locale::Unicode::TZ_NAME2ID->{$name} and defined $Locale::Unicode::TZ_NAME2ID->{$name} and length($Locale::Unicode::TZ_NAME2ID->{$name} // "")) 0 1 1
Condition37%3/8
exists $Locale::Unicode::TZ_NAME2ID->{$name} and defined $Locale::Unicode::TZ_NAME2ID->{$name} and length($Locale::Unicode::TZ_NAME2ID->{$name} // "")
!ll&&!rl&&r
001
exists $Locale::Unicode::TZ_NAME2ID->{$name} and defined $Locale::Unicode::TZ_NAME2ID->{$name}
!ll&&!rl&&r
001
$Locale::Unicode::TZ_NAME2ID->{$name} // ""
l!l
10
MC/DC0%0/3
exists $Locale::Unicode::TZ_NAME2ID->{$name} and defined $Locale::Unicode::TZ_NAME2ID->{$name} and length($Locale::Unicode::TZ_NAME2ID->{$name} // "")
exists $Locale::Unicode::TZ_NAME2ID->{$name} defined $Locale::Unicode::TZ_NAME2ID->{$name} $Locale::Unicode::TZ_NAME2ID->{$name}
Truth table25%1/4
A and B and C
A= exists $Locale::Unicode::TZ_NAME2ID->{$name}B= defined $Locale::Unicode::TZ_NAME2ID->{$name}C= $Locale::Unicode::TZ_NAME2ID->{$name}
ABCresult
0XX0
10X0
1100
1111
1780 !defined( $TZ_NAME2ID->{ $name } ) ||
1781 !length( $TZ_NAME2ID->{ $name } // '' ) )
1782 {
1783 0 return( '' );
1784 }
1785 1 return( $TZ_NAME2ID->{ $name } );
1786 }
1787  
1788 # u-mu
1789 48 ▶sub unit { return( shift->reset(@_)->_set_get_prop( 'unit', @_ ) ); }
Subroutine unit: called CC=1 SCAR=0.0
Pod documented
1790  
1791 # u-va
1792 48 ▶sub va { return( shift->reset(@_)->_set_get_prop( 'va', @_ ) ); }
Subroutine va: called CC=1 SCAR=0.0
Pod documented
1793  
1794 # u-va
1795 84 ▶sub variant { return( shift->reset(@_)->_set_get_prop( 'variant', @_ ) ); }
Subroutine variant: called CC=1 SCAR=0.0
Pod documented
1796  
1797 sub variants
1798 6 ▶{
Subroutine variants: called CC=2 SCAR=6.9
Pod documented
1799 6 my $self = shift( @_ );
1800 6 my $variants = [];
1801 6 ▶ if( my $variant = $self->variant )
Branch: 1 branch
BranchTrueFalseTotal
if (my $variant = $self->variant) 4 2 6
1802 {
1803 4 $variants = [split( /-/, $variant )];
1804 }
1805 6 return( $variants );
1806 }
1807  
1808 # u-vt
1809 0 ▶sub vt { return( shift->colVariableTop( @_ ) ); }
Subroutine vt: not called CC=1 SCAR=6.9
Pod documented
1810  
1811 # t-x0
1812 2 ▶sub x0 { return( shift->t_private( @_ ) ); }
Subroutine x0: called CC=1 SCAR=0.0
Pod documented
1813  
1814 sub _get_args_as_hash
1815 192 ▶{
Subroutine _get_args_as_hash: called CC=6 SCAR=19.0
1816 192 my $self = shift( @_ );
1817 192 my $ref = {};
1818 192 ▶ if( scalar( @_ ) == 1 &&
Branch: 2 branches
BranchTrueFalseTotal
if (scalar @_ == 1 and defined $_[0] and (ref $_[0] || '') eq 'HASH') { } 88 104 192
elsif (not scalar(@_) % 2) { } 104 0 104
Condition62%5/8
scalar @_ == 1 and defined $_[0] and (ref $_[0] || "") eq "HASH"
!ll&&!rl&&r
104088
scalar @_ == 1 and defined $_[0]
!ll&&!rl&&r
104088
ref $_[0] || ''
l!l
880
MC/DC33%1/3
scalar @_ == 1 and defined $_[0] and (ref $_[0] || "") eq "HASH"
scalar @_ == 1 defined $_[0] ref $_[0]
Truth table50%2/4
A and B and C
A= scalar @_ == 1B= defined $_[0]C= ref $_[0]
ABCresult
0XX0
10X0
1100
1111
1819 defined( $_[0] ) &&
1820 ( ref( $_[0] ) || '' ) eq 'HASH' )
1821 {
1822 88 $ref = shift( @_ );
1823 }
1824 elsif( !( scalar( @_ ) % 2 ) )
1825 {
1826 104 $ref = { @_ };
1827 }
1828 else
1829 {
1830 0 die( "Uneven number of parameters provided." );
1831 }
1832 192 return( $ref );
1833 }
1834  
1835 sub _set_get_prop
1836 2860 ▶{
Subroutine _set_get_prop: called CC=39 SCAR=48.9
1837 2860 my $self = shift( @_ );
1838 2860 ▶ my $field = shift( @_ ) ||
Condition50%1/2
shift @_ || (return $self->error('No field was provided.'))
l!l
28600
MC/DC0%0/1
shift @_ || (return $self->error('No field was provided.'))
shift @_
Truth table50%1/2
A
A= shift @_
Aresult
11
00
1839 return( $self->error( "No field was provided." ) );
1840 2860 my( $re, $type, $isa, $on_update );
1841 2860 ▶ if( ref( $field ) eq 'HASH' )
Branch: 1 branch
BranchTrueFalseTotal
if (ref $field eq "HASH") 1194 1666 2860
1842 {
1843 1194 my $def = $field;
1844 1194 ▶ $field = $def->{field} || die( "No 'field' property was provided in the field dictionary hash reference." );
Condition50%1/2
$def->{'field'} || die(q[No 'field' property was provided in the field dictionary hash reference.])
l!l
11940
MC/DC0%0/1
$def->{'field'} || die(q[No 'field' property was provided in the field dictionary hash reference.])
$def->{'field'}
Truth table50%1/2
A
A= $def->{'field'}
Aresult
11
00
1845 1194 ▶ if( exists( $def->{regexp} ) &&
Branch: 2 branches
BranchTrueFalseTotal
if (exists $def->{'regexp'} and defined $def->{'regexp'} and ref $def->{'regexp'} eq 'Regexp') { } 344 850 1194
elsif (exists $def->{'type'} and defined $def->{'type'} and length $def->{'type'}) { } 240 1220 1460
Condition66%4/6
exists $def->{"regexp"} and defined $def->{"regexp"} and ref $def->{"regexp"} eq "Regexp"
!ll&&!rl&&r
8500344
exists $def->{"regexp"} and defined $def->{"regexp"}
!ll&&!rl&&r
8500344
MC/DC33%1/3
exists $def->{"regexp"} and defined $def->{"regexp"} and ref $def->{"regexp"} eq "Regexp"
exists $def->{"regexp"} defined $def->{"regexp"} ref $def->{"regexp"} eq "Regexp"
Truth table50%2/4
A and B and C
A= exists $def->{"regexp"}B= defined $def->{"regexp"}C= ref $def->{"regexp"} eq "Regexp"
ABCresult
0XX0
10X0
1100
1111
1846 defined( $def->{regexp} ) &&
1847 ref( $def->{regexp} ) eq 'Regexp' )
1848 {
1849 344 $re = $def->{regexp};
1850 }
1851 ▶ elsif( exists( $def->{type} ) &&
Condition66%4/6
exists $def->{"type"} and defined $def->{"type"} and length $def->{"type"}
!ll&&!rl&&r
6100240
exists $def->{"type"} and defined $def->{"type"}
!ll&&!rl&&r
6100240
MC/DC33%1/3
exists $def->{"type"} and defined $def->{"type"} and length $def->{"type"}
exists $def->{"type"} defined $def->{"type"} length $def->{"type"}
Truth table50%2/4
A and B and C
A= exists $def->{"type"}B= defined $def->{"type"}C= length $def->{"type"}
ABCresult
0XX0
10X0
1100
1111
1852 defined( $def->{type} ) &&
1853 length( $def->{type} ) )
1854 {
1855 240 $type = $def->{type};
1856 }
1857 1194 ▶ if( exists( $def->{isa} ) &&
Branch: 1 branch
BranchTrueFalseTotal
if (exists $def->{"isa"} and defined $def->{"isa"} and length $def->{"isa"}) 68 1126 1194
Condition66%4/6
exists $def->{"isa"} and defined $def->{"isa"} and length $def->{"isa"}
!ll&&!rl&&r
1126068
exists $def->{"isa"} and defined $def->{"isa"}
!ll&&!rl&&r
1126068
MC/DC33%1/3
exists $def->{"isa"} and defined $def->{"isa"} and length $def->{"isa"}
exists $def->{"isa"} defined $def->{"isa"} length $def->{"isa"}
Truth table50%2/4
A and B and C
A= exists $def->{"isa"}B= defined $def->{"isa"}C= length $def->{"isa"}
ABCresult
0XX0
10X0
1100
1111
1858 defined( $def->{isa} ) &&
1859 length( $def->{isa} ) )
1860 {
1861 68 $isa = $def->{isa};
1862 }
1863 1194 ▶ if( exists( $def->{on_update} ) &&
Branch: 1 branch
BranchTrueFalseTotal
if (exists $def->{"on_update"} and defined $def->{"on_update"} and ref $def->{"on_update"} eq "CODE") 542 652 1194
Condition66%4/6
exists $def->{"on_update"} and defined $def->{"on_update"} and ref $def->{"on_update"} eq "CODE"
!ll&&!rl&&r
6520542
exists $def->{"on_update"} and defined $def->{"on_update"}
!ll&&!rl&&r
6520542
MC/DC33%1/3
exists $def->{"on_update"} and defined $def->{"on_update"} and ref $def->{"on_update"} eq "CODE"
exists $def->{"on_update"} defined $def->{"on_update"} ref $def->{"on_update"} eq "CODE"
Truth table50%2/4
A and B and C
A= exists $def->{"on_update"}B= defined $def->{"on_update"}C= ref $def->{"on_update"} eq "CODE"
ABCresult
0XX0
10X0
1100
1111
1864 defined( $def->{on_update} ) &&
1865 ref( $def->{on_update} ) eq 'CODE' )
1866 {
1867 542 $on_update = $def->{on_update};
1868 }
1869 }
1870 2860 ▶ if( @_ )
Branch: 1 branch
BranchTrueFalseTotal
if (@_) 204 2656 2860
1871 {
1872 204 my $val = shift( @_ );
1873 204 ▶ if( defined( $val ) &&
Branch: 1 branch
BranchTrueFalseTotal
if (defined $val and length $val) 201 3 204
Condition66%2/3
defined $val and length $val
!ll&&!rl&&r
30201
MC/DC50%1/2
defined $val and length $val
defined $val length $val
Truth table66%2/3
A and B
A= defined $valB= length $val
ABresult
0X0
100
111
1874 length( $val ) )
1875 {
1876 201 ▶ if( defined( $re ) &&
Branch: 3 branches
BranchTrueFalseTotal
if (defined $re and not $val =~ /^$re$/) { } 0 201 201
elsif (defined $type and $type eq 'boolean') { } 0 201 201
elsif (defined $isa) { } 12 189 201
Condition66%2/3
defined $re and not $val =~ /^$re$/
!ll&&!rl&&r
19740
MC/DC0%0/2
defined $re and not $val =~ /^$re$/
defined $re not $val =~ /^$re$/
Truth table66%2/3
A and not(B)
A= defined $reB= not $val =~ /^$re$/
ABresult
0X0
100
111
1877 $val !~ /^$re$/ )
1878 {
1879 0 return( $self->error( "Invalid value provided for \"${field}\": ${val}" ) );
1880 }
1881 ▶ elsif( defined( $type ) &&
Condition33%1/3
defined $type and $type eq "boolean"
!ll&&!rl&&r
20100
MC/DC0%0/2
defined $type and $type eq "boolean"
defined $type $type eq "boolean"
Truth table33%1/3
A and B
A= defined $typeB= $type eq "boolean"
ABresult
0X0
100
111
1882 $type eq 'boolean' )
1883 {
1884 0 $val = lc( $val );
1885 0 ▶ if( $val =~ /^(?:yes|no)$/i )
Branch: 3 branches
BranchTrueFalseTotal
if ($val =~ /^(?:yes|no)$/i) { } 0 0 0
elsif ($val =~ /^(?:true|false)$/i) { } 0 0 0
elsif ($val =~ /^(?:1|0)$/) { } 0 0 0
1886 {
1887 0 $self->{_bool_types}->{ $field } = 'literal';
1888 0 ▶ $val = ( $val eq 'yes' ? $self->true : $self->false );
Branch: 1 branch
BranchTrueFalseTotal
$val eq 'yes' ? : 0 0 0
1889 }
1890 elsif( $val =~ /^(?:true|false)$/i )
1891 {
1892 0 $self->{_bool_types}->{ $field } = 'logic';
1893 0 ▶ $val = ( $val eq 'true' ? $self->true : $self->false );
Branch: 1 branch
BranchTrueFalseTotal
$val eq 'true' ? : 0 0 0
1894 }
1895 elsif( $val =~ /^(?:1|0)$/ )
1896 {
1897 0 $self->{_bool_types}->{ $field } = 'logic';
1898 0 ▶ $val = ( $val ? $self->true : $self->false );
Branch: 1 branch
BranchTrueFalseTotal
$val ? : 0 0 0
1899 }
1900 else
1901 {
1902 0 ▶ warn( "Unexpected value used as boolean for attribute \"${field}\": ${val}" ) if( warnings::enabled() );
Branch: 1 branch
BranchTrueFalseTotal
if warnings::enabled() 0 0 0
1903 0 ▶ $val = ( $val ? $self->true : $self->false );
Branch: 1 branch
BranchTrueFalseTotal
$val ? : 0 0 0
1904 }
1905 }
1906 elsif( defined( $isa ) )
1907 {
1908 12 ▶ if( !Scalar::Util::blessed( $val ) ||
Branch: 1 branch
BranchTrueFalseTotal
if (not builtin::blessed($val) or builtin::blessed($val) and not $val->isa($isa)) 0 12 12
Condition33%2/6
not builtin::blessed($val) or builtin::blessed($val) and not $val->isa($isa)
l!l&&r!l&&!r
0012
builtin::blessed($val) and not $val->isa($isa)
!ll&&!rl&&r
0120
MC/DC0%0/3
not builtin::blessed($val) or builtin::blessed($val) and not $val->isa($isa)
not builtin::blessed($val) builtin::blessed($val) not $val->isa($isa)
Truth table25%1/4
not(A) or B and not(C)
A= not builtin::blessed($val)B= builtin::blessed($val)C= not $val->isa($isa)
ABCresult
1XX1
0111
00X0
0100
1909 ( Scalar::Util::blessed( $val ) && !$val->isa( $isa ) ) )
1910 {
1911 0 return( $self->error( "Value provided is not an ${isa} object." ) );
1912 }
1913 }
1914  
1915 201 ▶ if( defined( $on_update ) )
Branch: 1 branch
BranchTrueFalseTotal
if (defined $on_update) 126 75 201
1916 {
1917 126 local $@;
1918 126 eval{ $on_update->( $self, $val ) };
1919 126 ▶ if( $@ )
Branch: 1 branch
BranchTrueFalseTotal
if ($@) 0 126 126
1920 {
1921 0 return( $self->error( "Error setting value \"${val}\" for \"{field}\": $@" ) );
1922 }
1923 }
1924 }
1925 204 $self->{ $field } = $val
1926 }
1927 # So chaining works
1928 2860 ▶ rreturn( $self ) if( want( 'OBJECT' ) );
Branch: 1 branch
BranchTrueFalseTotal
if want("OBJECT") 1 2859 2860
1929 # Returns undef in scalar context and an empty list in list context
1930 2859 ▶ return if( !defined( $self->{ $field } ) );
Branch: 1 branch
BranchTrueFalseTotal
unless defined $self->{$field} 2395 464 2859
1931 464 return( $self->{ $field } );
1932 }
1933  
1934 {
1935 # NOTE: $TZ_DICT
1936 3 $TZ_DICT =
1937 {
1938 adalv => { desc => "Andorra", tz => "Europe/Andorra" },
1939 aedxb => { desc => "Dubai, United Arab Emirates", tz => "Asia/Dubai" },
1940 afkbl => { desc => "Kabul, Afghanistan", tz => "Asia/Kabul" },
1941 aganu => { desc => "Antigua", tz => "America/Antigua" },
1942 aiaxa => { desc => "Anguilla", tz => "America/Anguilla" },
1943 altia => { desc => "Tirane, Albania", tz => "Europe/Tirane" },
1944 amevn => { desc => "Yerevan, Armenia", tz => "Asia/Yerevan" },
1945 ancur => { desc => "Cura\xE7ao", tz => "America/Curacao" },
1946 aolad => { desc => "Luanda, Angola", tz => "Africa/Luanda" },
1947 aqams => {
1948 deprecated => 1,
1949 desc => "Amundsen-Scott Station, South Pole",
1950 preferred => "nzakl",
1951 },
1952 aqcas => { desc => "Casey Station, Bailey Peninsula", tz => "Antarctica/Casey" },
1953 aqdav => { desc => "Davis Station, Vestfold Hills", tz => "Antarctica/Davis" },
1954 aqddu => {
1955 desc => "Dumont d'Urville Station, Terre Ad\xE9lie",
1956 tz => "Antarctica/DumontDUrville",
1957 },
1958 aqmaw => { desc => "Mawson Station, Holme Bay", tz => "Antarctica/Mawson" },
1959 aqmcm => { desc => "McMurdo Station, Ross Island", tz => "Antarctica/McMurdo" },
1960 aqplm => { desc => "Palmer Station, Anvers Island", tz => "Antarctica/Palmer" },
1961 aqrot => {
1962 desc => "Rothera Station, Adelaide Island",
1963 tz => "Antarctica/Rothera",
1964 },
1965 aqsyw => {
1966 desc => "Syowa Station, East Ongul Island",
1967 tz => "Antarctica/Syowa",
1968 },
1969 aqtrl => { desc => "Troll Station, Queen Maud Land", tz => "Antarctica/Troll" },
1970 aqvos => { desc => "Vostok Station, Lake Vostok", tz => "Antarctica/Vostok" },
1971 arbue => {
1972 alias => [qw( America/Buenos_Aires America/Argentina/Buenos_Aires )],
1973 desc => "Buenos Aires, Argentina",
1974 tz => "America/Argentina/Buenos_Aires",
1975 },
1976 arcor => {
1977 alias => [qw( America/Cordoba America/Argentina/Cordoba America/Rosario )],
1978 desc => "C\xF3rdoba, Argentina",
1979 tz => "America/Argentina/Cordoba",
1980 },
1981 arctc => {
1982 alias => [qw(
1983 America/Catamarca America/Argentina/Catamarca
1984 America/Argentina/ComodRivadavia
1985 )],
1986 desc => "Catamarca, Argentina",
1987 tz => "America/Argentina/Catamarca",
1988 },
1989 arirj => { desc => "La Rioja, Argentina", tz => "America/Argentina/La_Rioja" },
1990 arjuj => {
1991 alias => [qw( America/Jujuy America/Argentina/Jujuy )],
1992 desc => "Jujuy, Argentina",
1993 tz => "America/Argentina/Jujuy",
1994 },
1995 arluq => { desc => "San Luis, Argentina", tz => "America/Argentina/San_Luis" },
1996 armdz => {
1997 alias => [qw( America/Mendoza America/Argentina/Mendoza )],
1998 desc => "Mendoza, Argentina",
1999 tz => "America/Argentina/Mendoza",
2000 },
2001 arrgl => {
2002 desc => "R\xEDo Gallegos, Argentina",
2003 tz => "America/Argentina/Rio_Gallegos",
2004 },
2005 arsla => { desc => "Salta, Argentina", tz => "America/Argentina/Salta" },
2006 artuc => { desc => "Tucum\xE1n, Argentina", tz => "America/Argentina/Tucuman" },
2007 aruaq => { desc => "San Juan, Argentina", tz => "America/Argentina/San_Juan" },
2008 arush => { desc => "Ushuaia, Argentina", tz => "America/Argentina/Ushuaia" },
2009 asppg => {
2010 alias => [qw( Pacific/Pago_Pago Pacific/Samoa US/Samoa )],
2011 desc => "Pago Pago, American Samoa",
2012 tz => "Pacific/Pago_Pago",
2013 },
2014 atvie => { desc => "Vienna, Austria", tz => "Europe/Vienna" },
2015 auadl => {
2016 alias => [qw( Australia/Adelaide Australia/South )],
2017 desc => "Adelaide, Australia",
2018 tz => "Australia/Adelaide",
2019 },
2020 aubhq => {
2021 alias => [qw( Australia/Broken_Hill Australia/Yancowinna )],
2022 desc => "Broken Hill, Australia",
2023 tz => "Australia/Broken_Hill",
2024 },
2025 aubne => {
2026 alias => [qw( Australia/Brisbane Australia/Queensland )],
2027 desc => "Brisbane, Australia",
2028 tz => "Australia/Brisbane",
2029 },
2030 audrw => {
2031 alias => [qw( Australia/Darwin Australia/North )],
2032 desc => "Darwin, Australia",
2033 tz => "Australia/Darwin",
2034 },
2035 aueuc => { desc => "Eucla, Australia", tz => "Australia/Eucla" },
2036 auhba => {
2037 alias => [qw( Australia/Hobart Australia/Tasmania Australia/Currie )],
2038 desc => "Hobart, Australia",
2039 tz => "Australia/Hobart",
2040 },
2041 aukns => { deprecated => 1, desc => "Currie, Australia", preferred => "auhba" },
2042 auldc => { desc => "Lindeman Island, Australia", tz => "Australia/Lindeman" },
2043 auldh => {
2044 alias => [qw( Australia/Lord_Howe Australia/LHI )],
2045 desc => "Lord Howe Island, Australia",
2046 tz => "Australia/Lord_Howe",
2047 },
2048 aumel => {
2049 alias => [qw( Australia/Melbourne Australia/Victoria )],
2050 desc => "Melbourne, Australia",
2051 tz => "Australia/Melbourne",
2052 },
2053 aumqi => {
2054 desc => "Macquarie Island Station, Macquarie Island",
2055 tz => "Antarctica/Macquarie",
2056 },
2057 auper => {
2058 alias => [qw( Australia/Perth Australia/West )],
2059 desc => "Perth, Australia",
2060 tz => "Australia/Perth",
2061 },
2062 ausyd => {
2063 alias => [qw(
2064 Australia/Sydney Australia/ACT Australia/Canberra
2065 Australia/NSW
2066 )],
2067 desc => "Sydney, Australia",
2068 tz => "Australia/Sydney",
2069 },
2070 awaua => { desc => "Aruba", tz => "America/Aruba" },
2071 azbak => { desc => "Baku, Azerbaijan", tz => "Asia/Baku" },
2072 basjj => { desc => "Sarajevo, Bosnia and Herzegovina", tz => "Europe/Sarajevo" },
2073 bbbgi => { desc => "Barbados", tz => "America/Barbados" },
2074 bddac => {
2075 alias => [qw( Asia/Dhaka Asia/Dacca )],
2076 desc => "Dhaka, Bangladesh",
2077 tz => "Asia/Dhaka",
2078 },
2079 bebru => { desc => "Brussels, Belgium", tz => "Europe/Brussels" },
2080 bfoua => { desc => "Ouagadougou, Burkina Faso", tz => "Africa/Ouagadougou" },
2081 bgsof => { desc => "Sofia, Bulgaria", tz => "Europe/Sofia" },
2082 bhbah => { desc => "Bahrain", tz => "Asia/Bahrain" },
2083 bibjm => { desc => "Bujumbura, Burundi", tz => "Africa/Bujumbura" },
2084 bjptn => { desc => "Porto-Novo, Benin", tz => "Africa/Porto-Novo" },
2085 bmbda => { desc => "Bermuda", tz => "Atlantic/Bermuda" },
2086 bnbwn => { desc => "Brunei", tz => "Asia/Brunei" },
2087 bolpb => { desc => "La Paz, Bolivia", tz => "America/La_Paz" },
2088 bqkra => {
2089 desc => "Bonaire, Sint Estatius and Saba",
2090 tz => "America/Kralendijk",
2091 },
2092 braux => { desc => "Aragua\xEDna, Brazil", tz => "America/Araguaina" },
2093 brbel => { desc => "Bel\xE9m, Brazil", tz => "America/Belem" },
2094 brbvb => { desc => "Boa Vista, Brazil", tz => "America/Boa_Vista" },
2095 brcgb => { desc => "Cuiab\xE1, Brazil", tz => "America/Cuiaba" },
2096 brcgr => { desc => "Campo Grande, Brazil", tz => "America/Campo_Grande" },
2097 brern => { desc => "Eirunep\xE9, Brazil", tz => "America/Eirunepe" },
2098 brfen => {
2099 alias => [qw( America/Noronha Brazil/DeNoronha )],
2100 desc => "Fernando de Noronha, Brazil",
2101 tz => "America/Noronha",
2102 },
2103 brfor => { desc => "Fortaleza, Brazil", tz => "America/Fortaleza" },
2104 brmao => {
2105 alias => [qw( America/Manaus Brazil/West )],
2106 desc => "Manaus, Brazil",
2107 tz => "America/Manaus",
2108 },
2109 brmcz => { desc => "Macei\xF3, Brazil", tz => "America/Maceio" },
2110 brpvh => { desc => "Porto Velho, Brazil", tz => "America/Porto_Velho" },
2111 brrbr => {
2112 alias => [qw( America/Rio_Branco America/Porto_Acre Brazil/Acre )],
2113 desc => "Rio Branco, Brazil",
2114 tz => "America/Rio_Branco",
2115 },
2116 brrec => { desc => "Recife, Brazil", tz => "America/Recife" },
2117 brsao => {
2118 alias => [qw( America/Sao_Paulo Brazil/East )],
2119 desc => "S\xE3o Paulo, Brazil",
2120 tz => "America/Sao_Paulo",
2121 },
2122 brssa => { desc => "Bahia, Brazil", tz => "America/Bahia" },
2123 brstm => { desc => "Santar\xE9m, Brazil", tz => "America/Santarem" },
2124 bsnas => { desc => "Nassau, Bahamas", tz => "America/Nassau" },
2125 btthi => {
2126 alias => [qw( Asia/Thimphu Asia/Thimbu )],
2127 desc => "Thimphu, Bhutan",
2128 tz => "Asia/Thimphu",
2129 },
2130 bwgbe => { desc => "Gaborone, Botswana", tz => "Africa/Gaborone" },
2131 bymsq => { desc => "Minsk, Belarus", tz => "Europe/Minsk" },
2132 bzbze => { desc => "Belize", tz => "America/Belize" },
2133 cacfq => { desc => "Creston, Canada", tz => "America/Creston" },
2134 caedm => {
2135 alias => [qw( America/Edmonton Canada/Mountain America/Yellowknife )],
2136 desc => "Edmonton, Canada",
2137 tz => "America/Edmonton",
2138 },
2139 caffs => { deprecated => 1, desc => "Rainy River, Canada", preferred => "cawnp" },
2140 cafne => { desc => "Fort Nelson, Canada", tz => "America/Fort_Nelson" },
2141 caglb => { desc => "Glace Bay, Canada", tz => "America/Glace_Bay" },
2142 cagoo => { desc => "Goose Bay, Canada", tz => "America/Goose_Bay" },
2143 cahal => {
2144 alias => [qw( America/Halifax Canada/Atlantic )],
2145 desc => "Halifax, Canada",
2146 tz => "America/Halifax",
2147 },
2148 caiql => {
2149 alias => [qw( America/Iqaluit America/Pangnirtung )],
2150 desc => "Iqaluit, Canada",
2151 tz => "America/Iqaluit",
2152 },
2153 camon => { desc => "Moncton, Canada", tz => "America/Moncton" },
2154 camtr => { deprecated => 1, desc => "Montreal, Canada", preferred => "cator" },
2155 canpg => { deprecated => 1, desc => "Nipigon, Canada", preferred => "cator" },
2156 capnt => { deprecated => 1, desc => "Pangnirtung, Canada", preferred => "caiql" },
2157 careb => { desc => "Resolute, Canada", tz => "America/Resolute" },
2158 careg => {
2159 alias => [qw( America/Regina Canada/East-Saskatchewan Canada/Saskatchewan )],
2160 desc => "Regina, Canada",
2161 tz => "America/Regina",
2162 },
2163 casjf => {
2164 alias => [qw( America/St_Johns Canada/Newfoundland )],
2165 desc => "St. John's, Canada",
2166 tz => "America/St_Johns",
2167 },
2168 cathu => { deprecated => 1, desc => "Thunder Bay, Canada", preferred => "cator" },
2169 cator => {
2170 alias => [qw(
2171 America/Toronto America/Montreal Canada/Eastern
2172 America/Nipigon America/Thunder_Bay
2173 )],
2174 desc => "Toronto, Canada",
2175 tz => "America/Toronto",
2176 },
2177 cavan => {
2178 alias => [qw( America/Vancouver Canada/Pacific )],
2179 desc => "Vancouver, Canada",
2180 tz => "America/Vancouver",
2181 },
2182 cawnp => {
2183 alias => [qw( America/Winnipeg Canada/Central America/Rainy_River )],
2184 desc => "Winnipeg, Canada",
2185 tz => "America/Winnipeg",
2186 },
2187 caybx => { desc => "Blanc-Sablon, Canada", tz => "America/Blanc-Sablon" },
2188 caycb => { desc => "Cambridge Bay, Canada", tz => "America/Cambridge_Bay" },
2189 cayda => { desc => "Dawson, Canada", tz => "America/Dawson" },
2190 caydq => { desc => "Dawson Creek, Canada", tz => "America/Dawson_Creek" },
2191 cayek => { desc => "Rankin Inlet, Canada", tz => "America/Rankin_Inlet" },
2192 cayev => { desc => "Inuvik, Canada", tz => "America/Inuvik" },
2193 cayxy => {
2194 alias => [qw( America/Whitehorse Canada/Yukon )],
2195 desc => "Whitehorse, Canada",
2196 tz => "America/Whitehorse",
2197 },
2198 cayyn => { desc => "Swift Current, Canada", tz => "America/Swift_Current" },
2199 cayzf => { deprecated => 1, desc => "Yellowknife, Canada", preferred => "caedm" },
2200 cayzs => {
2201 alias => [qw( America/Coral_Harbour America/Atikokan )],
2202 desc => "Atikokan, Canada",
2203 tz => "America/Atikokan",
2204 },
2205 cccck => { desc => "Cocos (Keeling) Islands", tz => "Indian/Cocos" },
2206 cdfbm => {
2207 desc => "Lubumbashi, Democratic Republic of the Congo",
2208 tz => "Africa/Lubumbashi",
2209 },
2210 cdfih => {
2211 desc => "Kinshasa, Democratic Republic of the Congo",
2212 tz => "Africa/Kinshasa",
2213 },
2214 cfbgf => { desc => "Bangui, Central African Republic", tz => "Africa/Bangui" },
2215 cgbzv => {
2216 desc => "Brazzaville, Republic of the Congo",
2217 tz => "Africa/Brazzaville",
2218 },
2219 chzrh => { desc => "Zurich, Switzerland", tz => "Europe/Zurich" },
2220 ciabj => { desc => "Abidjan, C\xF4te d'Ivoire", tz => "Africa/Abidjan" },
2221 ckrar => { desc => "Rarotonga, Cook Islands", tz => "Pacific/Rarotonga" },
2222 clipc => {
2223 alias => [qw( Pacific/Easter Chile/EasterIsland )],
2224 desc => "Easter Island, Chile",
2225 tz => "Pacific/Easter",
2226 },
2227 clpuq => { desc => "Punta Arenas, Chile", tz => "America/Punta_Arenas" },
2228 clscl => {
2229 alias => [qw( America/Santiago Chile/Continental )],
2230 desc => "Santiago, Chile",
2231 tz => "America/Santiago",
2232 },
2233 cmdla => { desc => "Douala, Cameroon", tz => "Africa/Douala" },
2234 cnckg => { deprecated => 1, desc => "Chongqing, China", preferred => "cnsha" },
2235 cnhrb => { deprecated => 1, desc => "Harbin, China", preferred => "cnsha" },
2236 cnkhg => { deprecated => 1, desc => "Kashgar, China", preferred => "cnurc" },
2237 cnsha => {
2238 alias => [qw( Asia/Shanghai Asia/Chongqing Asia/Chungking Asia/Harbin PRC )],
2239 desc => "Shanghai, China",
2240 tz => "Asia/Shanghai",
2241 },
2242 cnurc => {
2243 alias => [qw( Asia/Urumqi Asia/Kashgar )],
2244 desc => "\xDCr\xFCmqi, China",
2245 tz => "Asia/Urumqi",
2246 },
2247 cobog => { desc => "Bogot\xE1, Colombia", tz => "America/Bogota" },
2248 crsjo => { desc => "Costa Rica", tz => "America/Costa_Rica" },
2249 cst6cdt => {
2250 desc => "POSIX style time zone for US Central Time",
2251 tz => "CST6CDT",
2252 },
2253 cuhav => {
2254 alias => [qw( America/Havana Cuba )],
2255 desc => "Havana, Cuba",
2256 tz => "America/Havana",
2257 },
2258 cvrai => { desc => "Cape Verde", tz => "Atlantic/Cape_Verde" },
2259 cxxch => { desc => "Christmas Island", tz => "Indian/Christmas" },
2260 cyfmg => { desc => "Famagusta, Cyprus", tz => "Asia/Famagusta" },
2261 cynic => {
2262 alias => [qw( Asia/Nicosia Europe/Nicosia )],
2263 desc => "Nicosia, Cyprus",
2264 tz => "Asia/Nicosia",
2265 },
2266 czprg => { desc => "Prague, Czech Republic", tz => "Europe/Prague" },
2267 deber => { desc => "Berlin, Germany", tz => "Europe/Berlin" },
2268 debsngn => { desc => "Busingen, Germany", tz => "Europe/Busingen" },
2269 deprecated => 1,
2270 djjib => { desc => "Djibouti", tz => "Africa/Djibouti" },
2271 dkcph => { desc => "Copenhagen, Denmark", tz => "Europe/Copenhagen" },
2272 dmdom => { desc => "Dominica", tz => "America/Dominica" },
2273 dosdq => {
2274 desc => "Santo Domingo, Dominican Republic",
2275 tz => "America/Santo_Domingo",
2276 },
2277 dzalg => { desc => "Algiers, Algeria", tz => "Africa/Algiers" },
2278 ecgps => { desc => "Gal\xE1pagos Islands, Ecuador", tz => "Pacific/Galapagos" },
2279 ecgye => { desc => "Guayaquil, Ecuador", tz => "America/Guayaquil" },
2280 eetll => { desc => "Tallinn, Estonia", tz => "Europe/Tallinn" },
2281 egcai => {
2282 alias => [qw( Africa/Cairo Egypt )],
2283 desc => "Cairo, Egypt",
2284 tz => "Africa/Cairo",
2285 },
2286 eheai => { desc => "El Aai\xFAn, Western Sahara", tz => "Africa/El_Aaiun" },
2287 erasm => {
2288 alias => [qw( Africa/Asmera Africa/Asmara )],
2289 desc => "Asmara, Eritrea",
2290 tz => "Africa/Asmara",
2291 },
2292 esceu => { desc => "Ceuta, Spain", tz => "Africa/Ceuta" },
2293 eslpa => { desc => "Canary Islands, Spain", tz => "Atlantic/Canary" },
2294 esmad => { desc => "Madrid, Spain", tz => "Europe/Madrid" },
2295 est5edt => {
2296 desc => "POSIX style time zone for US Eastern Time",
2297 tz => "EST5EDT",
2298 },
2299 etadd => { desc => "Addis Ababa, Ethiopia", tz => "Africa/Addis_Ababa" },
2300 fihel => { desc => "Helsinki, Finland", tz => "Europe/Helsinki" },
2301 fimhq => { desc => "Mariehamn, \xC5land, Finland", tz => "Europe/Mariehamn" },
2302 fjsuv => { desc => "Fiji", tz => "Pacific/Fiji" },
2303 fkpsy => { desc => "Stanley, Falkland Islands", tz => "Atlantic/Stanley" },
2304 fmksa => { desc => "Kosrae, Micronesia", tz => "Pacific/Kosrae" },
2305 fmpni => {
2306 alias => [qw( Pacific/Ponape Pacific/Pohnpei )],
2307 desc => "Pohnpei, Micronesia",
2308 tz => "Pacific/Pohnpei",
2309 },
2310 fmtkk => {
2311 alias => [qw( Pacific/Truk Pacific/Chuuk Pacific/Yap )],
2312 desc => "Chuuk, Micronesia",
2313 tz => "Pacific/Chuuk",
2314 },
2315 fotho => {
2316 alias => [qw( Atlantic/Faeroe Atlantic/Faroe )],
2317 desc => "Faroe Islands",
2318 tz => "Atlantic/Faroe",
2319 },
2320 frpar => { desc => "Paris, France", tz => "Europe/Paris" },
2321 galbv => { desc => "Libreville, Gabon", tz => "Africa/Libreville" },
2322 gaza => {
2323 deprecated => 1,
2324 desc => "Gaza Strip, Palestinian Territories",
2325 preferred => "gazastrp",
2326 },
2327 gazastrp => { desc => "Gaza Strip, Palestinian Territories", tz => "Asia/Gaza" },
2328 gblon => {
2329 alias => [qw( Europe/London Europe/Belfast GB GB-Eire )],
2330 desc => "London, United Kingdom",
2331 tz => "Europe/London",
2332 },
2333 gdgnd => { desc => "Grenada", tz => "America/Grenada" },
2334 getbs => { desc => "Tbilisi, Georgia", tz => "Asia/Tbilisi" },
2335 gfcay => { desc => "Cayenne, French Guiana", tz => "America/Cayenne" },
2336 gggci => { desc => "Guernsey", tz => "Europe/Guernsey" },
2337 ghacc => { desc => "Accra, Ghana", tz => "Africa/Accra" },
2338 gigib => { desc => "Gibraltar", tz => "Europe/Gibraltar" },
2339 gldkshvn => { desc => "Danmarkshavn, Greenland", tz => "America/Danmarkshavn" },
2340 glgoh => {
2341 alias => [qw( America/Godthab America/Nuuk )],
2342 desc => "Nuuk (Godth\xE5b), Greenland",
2343 tz => "America/Nuuk",
2344 },
2345 globy => {
2346 desc => "Ittoqqortoormiit (Scoresbysund), Greenland",
2347 tz => "America/Scoresbysund",
2348 },
2349 glthu => { desc => "Qaanaaq (Thule), Greenland", tz => "America/Thule" },
2350 gmbjl => { desc => "Banjul, Gambia", tz => "Africa/Banjul" },
2351 gmt => {
2352 alias => [qw(
2353 Etc/GMT Etc/GMT+0 Etc/GMT-0 Etc/GMT0 Etc/Greenwich GMT
2354 GMT+0 GMT-0 GMT0 Greenwich
2355 )],
2356 desc => "Greenwich Mean Time",
2357 tz => "Etc/GMT",
2358 },
2359 gncky => { desc => "Conakry, Guinea", tz => "Africa/Conakry" },
2360 gpbbr => { desc => "Guadeloupe", tz => "America/Guadeloupe" },
2361 gpmsb => { desc => "Marigot, Saint Martin", tz => "America/Marigot" },
2362 gpsbh => { desc => "Saint Barth\xE9lemy", tz => "America/St_Barthelemy" },
2363 gqssg => { desc => "Malabo, Equatorial Guinea", tz => "Africa/Malabo" },
2364 grath => { desc => "Athens, Greece", tz => "Europe/Athens" },
2365 gsgrv => {
2366 desc => "South Georgia and the South Sandwich Islands",
2367 tz => "Atlantic/South_Georgia",
2368 },
2369 gtgua => { desc => "Guatemala", tz => "America/Guatemala" },
2370 gugum => { desc => "Guam", tz => "Pacific/Guam" },
2371 gwoxb => { desc => "Bissau, Guinea-Bissau", tz => "Africa/Bissau" },
2372 gygeo => { desc => "Guyana", tz => "America/Guyana" },
2373 hebron => { desc => "West Bank, Palestinian Territories", tz => "Asia/Hebron" },
2374 hkhkg => {
2375 alias => [qw( Asia/Hong_Kong Hongkong )],
2376 desc => "Hong Kong SAR China",
2377 tz => "Asia/Hong_Kong",
2378 },
2379 hntgu => { desc => "Tegucigalpa, Honduras", tz => "America/Tegucigalpa" },
2380 hrzag => { desc => "Zagreb, Croatia", tz => "Europe/Zagreb" },
2381 htpap => { desc => "Port-au-Prince, Haiti", tz => "America/Port-au-Prince" },
2382 hubud => { desc => "Budapest, Hungary", tz => "Europe/Budapest" },
2383 iddjj => { desc => "Jayapura, Indonesia", tz => "Asia/Jayapura" },
2384 idjkt => { desc => "Jakarta, Indonesia", tz => "Asia/Jakarta" },
2385 idmak => {
2386 alias => [qw( Asia/Makassar Asia/Ujung_Pandang )],
2387 desc => "Makassar, Indonesia",
2388 tz => "Asia/Makassar",
2389 },
2390 idpnk => { desc => "Pontianak, Indonesia", tz => "Asia/Pontianak" },
2391 iedub => {
2392 alias => [qw( Europe/Dublin Eire )],
2393 desc => "Dublin, Ireland",
2394 tz => "Europe/Dublin",
2395 },
2396 imdgs => { desc => "Isle of Man", tz => "Europe/Isle_of_Man" },
2397 inccu => {
2398 alias => [qw( Asia/Calcutta Asia/Kolkata )],
2399 desc => "Kolkata, India",
2400 tz => "Asia/Kolkata",
2401 },
2402 iodga => { desc => "Chagos Archipelago", tz => "Indian/Chagos" },
2403 iqbgw => { desc => "Baghdad, Iraq", tz => "Asia/Baghdad" },
2404 irthr => {
2405 alias => [qw( Asia/Tehran Iran )],
2406 desc => "Tehran, Iran",
2407 tz => "Asia/Tehran",
2408 },
2409 isrey => {
2410 alias => [qw( Atlantic/Reykjavik Iceland )],
2411 desc => "Reykjavik, Iceland",
2412 tz => "Atlantic/Reykjavik",
2413 },
2414 itrom => { desc => "Rome, Italy", tz => "Europe/Rome" },
2415 jeruslm => {
2416 alias => [qw( Asia/Jerusalem Asia/Tel_Aviv Israel )],
2417 desc => "Jerusalem",
2418 tz => "Asia/Jerusalem",
2419 },
2420 jesth => { desc => "Jersey", tz => "Europe/Jersey" },
2421 jmkin => {
2422 alias => [qw( America/Jamaica Jamaica )],
2423 desc => "Jamaica",
2424 tz => "America/Jamaica",
2425 },
2426 joamm => { desc => "Amman, Jordan", tz => "Asia/Amman" },
2427 jptyo => {
2428 alias => [qw( Asia/Tokyo Japan )],
2429 desc => "Tokyo, Japan",
2430 tz => "Asia/Tokyo",
2431 },
2432 kenbo => { desc => "Nairobi, Kenya", tz => "Africa/Nairobi" },
2433 kgfru => { desc => "Bishkek, Kyrgyzstan", tz => "Asia/Bishkek" },
2434 khpnh => { desc => "Phnom Penh, Cambodia", tz => "Asia/Phnom_Penh" },
2435 kicxi => { desc => "Kiritimati, Kiribati", tz => "Pacific/Kiritimati" },
2436 kipho => {
2437 alias => [qw( Pacific/Enderbury Pacific/Kanton )],
2438 desc => "Enderbury Island, Kiribati",
2439 tz => "Pacific/Kanton",
2440 },
2441 kitrw => { desc => "Tarawa, Kiribati", tz => "Pacific/Tarawa" },
2442 kmyva => { desc => "Comoros", tz => "Indian/Comoro" },
2443 knbas => { desc => "Saint Kitts", tz => "America/St_Kitts" },
2444 kpfnj => { desc => "Pyongyang, North Korea", tz => "Asia/Pyongyang" },
2445 krsel => {
2446 alias => [qw( Asia/Seoul ROK )],
2447 desc => "Seoul, South Korea",
2448 tz => "Asia/Seoul",
2449 },
2450 kwkwi => { desc => "Kuwait", tz => "Asia/Kuwait" },
2451 kygec => { desc => "Cayman Islands", tz => "America/Cayman" },
2452 kzaau => { desc => "Aqtau, Kazakhstan", tz => "Asia/Aqtau" },
2453 kzakx => { desc => "Aqtobe, Kazakhstan", tz => "Asia/Aqtobe" },
2454 kzala => { desc => "Almaty, Kazakhstan", tz => "Asia/Almaty" },
2455 kzguw => { desc => "Atyrau (Guryev), Kazakhstan", tz => "Asia/Atyrau" },
2456 kzksn => { desc => "Qostanay (Kostanay), Kazakhstan", tz => "Asia/Qostanay" },
2457 kzkzo => { desc => "Kyzylorda, Kazakhstan", tz => "Asia/Qyzylorda" },
2458 kzura => { desc => "Oral, Kazakhstan", tz => "Asia/Oral" },
2459 lavte => { desc => "Vientiane, Laos", tz => "Asia/Vientiane" },
2460 lbbey => { desc => "Beirut, Lebanon", tz => "Asia/Beirut" },
2461 lccas => { desc => "Saint Lucia", tz => "America/St_Lucia" },
2462 livdz => { desc => "Vaduz, Liechtenstein", tz => "Europe/Vaduz" },
2463 lkcmb => { desc => "Colombo, Sri Lanka", tz => "Asia/Colombo" },
2464 lrmlw => { desc => "Monrovia, Liberia", tz => "Africa/Monrovia" },
2465 lsmsu => { desc => "Maseru, Lesotho", tz => "Africa/Maseru" },
2466 ltvno => { desc => "Vilnius, Lithuania", tz => "Europe/Vilnius" },
2467 lulux => { desc => "Luxembourg", tz => "Europe/Luxembourg" },
2468 lvrix => { desc => "Riga, Latvia", tz => "Europe/Riga" },
2469 lytip => {
2470 alias => [qw( Africa/Tripoli Libya )],
2471 desc => "Tripoli, Libya",
2472 tz => "Africa/Tripoli",
2473 },
2474 macas => { desc => "Casablanca, Morocco", tz => "Africa/Casablanca" },
2475 mcmon => { desc => "Monaco", tz => "Europe/Monaco" },
2476 mdkiv => {
2477 alias => [qw( Europe/Chisinau Europe/Tiraspol )],
2478 desc => "Chi\x{15F}in\x{103}u, Moldova",
2479 tz => "Europe/Chisinau",
2480 },
2481 metgd => { desc => "Podgorica, Montenegro", tz => "Europe/Podgorica" },
2482 mgtnr => { desc => "Antananarivo, Madagascar", tz => "Indian/Antananarivo" },
2483 mhkwa => {
2484 alias => [qw( Pacific/Kwajalein Kwajalein )],
2485 desc => "Kwajalein, Marshall Islands",
2486 tz => "Pacific/Kwajalein",
2487 },
2488 mhmaj => { desc => "Majuro, Marshall Islands", tz => "Pacific/Majuro" },
2489 mkskp => { desc => "Skopje, Macedonia", tz => "Europe/Skopje" },
2490 mlbko => {
2491 alias => [qw( Africa/Bamako Africa/Timbuktu )],
2492 desc => "Bamako, Mali",
2493 tz => "Africa/Bamako",
2494 },
2495 mmrgn => {
2496 alias => [qw( Asia/Rangoon Asia/Yangon )],
2497 desc => "Yangon (Rangoon), Burma",
2498 tz => "Asia/Yangon",
2499 },
2500 mncoq => { desc => "Choibalsan, Mongolia", tz => "Asia/Choibalsan" },
2501 mnhvd => { desc => "Khovd (Hovd), Mongolia", tz => "Asia/Hovd" },
2502 mnuln => {
2503 alias => [qw( Asia/Ulaanbaatar Asia/Ulan_Bator )],
2504 desc => "Ulaanbaatar (Ulan Bator), Mongolia",
2505 tz => "Asia/Ulaanbaatar",
2506 },
2507 momfm => {
2508 alias => [qw( Asia/Macau Asia/Macao )],
2509 desc => "Macau SAR China",
2510 tz => "Asia/Macau",
2511 },
2512 mpspn => { desc => "Saipan, Northern Mariana Islands", tz => "Pacific/Saipan" },
2513 mqfdf => { desc => "Martinique", tz => "America/Martinique" },
2514 mrnkc => { desc => "Nouakchott, Mauritania", tz => "Africa/Nouakchott" },
2515 msmni => { desc => "Montserrat", tz => "America/Montserrat" },
2516 mst7mdt => {
2517 desc => "POSIX style time zone for US Mountain Time",
2518 tz => "MST7MDT",
2519 },
2520 mtmla => { desc => "Malta", tz => "Europe/Malta" },
2521 muplu => { desc => "Mauritius", tz => "Indian/Mauritius" },
2522 mvmle => { desc => "Maldives", tz => "Indian/Maldives" },
2523 mwblz => { desc => "Blantyre, Malawi", tz => "Africa/Blantyre" },
2524 mxchi => { desc => "Chihuahua, Mexico", tz => "America/Chihuahua" },
2525 mxcjs => { desc => "Ciudad Ju\xE1rez, Mexico", tz => "America/Ciudad_Juarez" },
2526 mxcun => { desc => "Canc\xFAn, Mexico", tz => "America/Cancun" },
2527 mxhmo => { desc => "Hermosillo, Mexico", tz => "America/Hermosillo" },
2528 mxmam => { desc => "Matamoros, Mexico", tz => "America/Matamoros" },
2529 mxmex => {
2530 alias => [qw( America/Mexico_City Mexico/General )],
2531 desc => "Mexico City, Mexico",
2532 tz => "America/Mexico_City",
2533 },
2534 mxmid => { desc => "M\xE9rida, Mexico", tz => "America/Merida" },
2535 mxmty => { desc => "Monterrey, Mexico", tz => "America/Monterrey" },
2536 mxmzt => {
2537 alias => [qw( America/Mazatlan Mexico/BajaSur )],
2538 desc => "Mazatl\xE1n, Mexico",
2539 tz => "America/Mazatlan",
2540 },
2541 mxoji => { desc => "Ojinaga, Mexico", tz => "America/Ojinaga" },
2542 mxpvr => {
2543 desc => "Bah\xEDa de Banderas, Mexico",
2544 tz => "America/Bahia_Banderas",
2545 },
2546 mxstis => {
2547 deprecated => 1,
2548 desc => "Santa Isabel (Baja California), Mexico",
2549 preferred => "mxtij",
2550 },
2551 mxtij => {
2552 alias => [qw(
2553 America/Tijuana America/Ensenada Mexico/BajaNorte
2554 America/Santa_Isabel
2555 )],
2556 desc => "Tijuana, Mexico",
2557 tz => "America/Tijuana",
2558 },
2559 mykch => { desc => "Kuching, Malaysia", tz => "Asia/Kuching" },
2560 mykul => { desc => "Kuala Lumpur, Malaysia", tz => "Asia/Kuala_Lumpur" },
2561 mzmpm => { desc => "Maputo, Mozambique", tz => "Africa/Maputo" },
2562 nawdh => { desc => "Windhoek, Namibia", tz => "Africa/Windhoek" },
2563 ncnou => { desc => "Noumea, New Caledonia", tz => "Pacific/Noumea" },
2564 nenim => { desc => "Niamey, Niger", tz => "Africa/Niamey" },
2565 nfnlk => { desc => "Norfolk Island", tz => "Pacific/Norfolk" },
2566 nglos => { desc => "Lagos, Nigeria", tz => "Africa/Lagos" },
2567 nimga => { desc => "Managua, Nicaragua", tz => "America/Managua" },
2568 nlams => { desc => "Amsterdam, Netherlands", tz => "Europe/Amsterdam" },
2569 noosl => { desc => "Oslo, Norway", tz => "Europe/Oslo" },
2570 npktm => {
2571 alias => [qw( Asia/Katmandu Asia/Kathmandu )],
2572 desc => "Kathmandu, Nepal",
2573 tz => "Asia/Kathmandu",
2574 },
2575 nrinu => { desc => "Nauru", tz => "Pacific/Nauru" },
2576 nuiue => { desc => "Niue", tz => "Pacific/Niue" },
2577 nzakl => {
2578 alias => [qw( Pacific/Auckland Antarctica/South_Pole NZ )],
2579 desc => "Auckland, New Zealand",
2580 tz => "Pacific/Auckland",
2581 },
2582 nzcht => {
2583 alias => [qw( Pacific/Chatham NZ-CHAT )],
2584 desc => "Chatham Islands, New Zealand",
2585 tz => "Pacific/Chatham",
2586 },
2587 ommct => { desc => "Muscat, Oman", tz => "Asia/Muscat" },
2588 papty => { desc => "Panama", tz => "America/Panama" },
2589 pelim => { desc => "Lima, Peru", tz => "America/Lima" },
2590 pfgmr => {
2591 desc => "Gambiera Islands, French Polynesia",
2592 tz => "Pacific/Gambier",
2593 },
2594 pfnhv => {
2595 desc => "Marquesas Islands, French Polynesia",
2596 tz => "Pacific/Marquesas",
2597 },
2598 pfppt => { desc => "Tahiti, French Polynesia", tz => "Pacific/Tahiti" },
2599 pgpom => {
2600 desc => "Port Moresby, Papua New Guinea",
2601 tz => "Pacific/Port_Moresby",
2602 },
2603 pgraw => {
2604 desc => "Bougainville, Papua New Guinea",
2605 tz => "Pacific/Bougainville",
2606 },
2607 phmnl => { desc => "Manila, Philippines", tz => "Asia/Manila" },
2608 pkkhi => { desc => "Karachi, Pakistan", tz => "Asia/Karachi" },
2609 plwaw => {
2610 alias => [qw( Europe/Warsaw Poland )],
2611 desc => "Warsaw, Poland",
2612 tz => "Europe/Warsaw",
2613 },
2614 pmmqc => { desc => "Saint Pierre and Miquelon", tz => "America/Miquelon" },
2615 pnpcn => { desc => "Pitcairn Islands", tz => "Pacific/Pitcairn" },
2616 prsju => { desc => "Puerto Rico", tz => "America/Puerto_Rico" },
2617 pst8pdt => {
2618 desc => "POSIX style time zone for US Pacific Time",
2619 tz => "PST8PDT",
2620 },
2621 ptfnc => { desc => "Madeira, Portugal", tz => "Atlantic/Madeira" },
2622 ptlis => {
2623 alias => [qw( Europe/Lisbon Portugal )],
2624 desc => "Lisbon, Portugal",
2625 tz => "Europe/Lisbon",
2626 },
2627 ptpdl => { desc => "Azores, Portugal", tz => "Atlantic/Azores" },
2628 pwror => { desc => "Palau", tz => "Pacific/Palau" },
2629 pyasu => { desc => "Asunci\xF3n, Paraguay", tz => "America/Asuncion" },
2630 qadoh => { desc => "Qatar", tz => "Asia/Qatar" },
2631 rereu => { desc => "R\xE9union", tz => "Indian/Reunion" },
2632 robuh => { desc => "Bucharest, Romania", tz => "Europe/Bucharest" },
2633 rsbeg => { desc => "Belgrade, Serbia", tz => "Europe/Belgrade" },
2634 ruasf => { desc => "Astrakhan, Russia", tz => "Europe/Astrakhan" },
2635 rubax => { desc => "Barnaul, Russia", tz => "Asia/Barnaul" },
2636 ruchita => { desc => "Chita Zabaykalsky, Russia", tz => "Asia/Chita" },
2637 rudyr => { desc => "Anadyr, Russia", tz => "Asia/Anadyr" },
2638 rugdx => { desc => "Magadan, Russia", tz => "Asia/Magadan" },
2639 ruikt => { desc => "Irkutsk, Russia", tz => "Asia/Irkutsk" },
2640 rukgd => { desc => "Kaliningrad, Russia", tz => "Europe/Kaliningrad" },
2641 rukhndg => { desc => "Khandyga Tomponsky, Russia", tz => "Asia/Khandyga" },
2642 rukra => { desc => "Krasnoyarsk, Russia", tz => "Asia/Krasnoyarsk" },
2643 rukuf => { desc => "Samara, Russia", tz => "Europe/Samara" },
2644 rukvx => { desc => "Kirov, Russia", tz => "Europe/Kirov" },
2645 rumow => {
2646 alias => [qw( Europe/Moscow W-SU )],
2647 desc => "Moscow, Russia",
2648 tz => "Europe/Moscow",
2649 },
2650 runoz => { desc => "Novokuznetsk, Russia", tz => "Asia/Novokuznetsk" },
2651 ruoms => { desc => "Omsk, Russia", tz => "Asia/Omsk" },
2652 ruovb => { desc => "Novosibirsk, Russia", tz => "Asia/Novosibirsk" },
2653 rupkc => { desc => "Kamchatka Peninsula, Russia", tz => "Asia/Kamchatka" },
2654 rurtw => { desc => "Saratov, Russia", tz => "Europe/Saratov" },
2655 rusred => { desc => "Srednekolymsk, Russia", tz => "Asia/Srednekolymsk" },
2656 rutof => { desc => "Tomsk, Russia", tz => "Asia/Tomsk" },
2657 ruuly => { desc => "Ulyanovsk, Russia", tz => "Europe/Ulyanovsk" },
2658 ruunera => { desc => "Ust-Nera Oymyakonsky, Russia", tz => "Asia/Ust-Nera" },
2659 ruuus => { desc => "Sakhalin, Russia", tz => "Asia/Sakhalin" },
2660 ruvog => { desc => "Volgograd, Russia", tz => "Europe/Volgograd" },
2661 ruvvo => { desc => "Vladivostok, Russia", tz => "Asia/Vladivostok" },
2662 ruyek => { desc => "Yekaterinburg, Russia", tz => "Asia/Yekaterinburg" },
2663 ruyks => { desc => "Yakutsk, Russia", tz => "Asia/Yakutsk" },
2664 rwkgl => { desc => "Kigali, Rwanda", tz => "Africa/Kigali" },
2665 saruh => { desc => "Riyadh, Saudi Arabia", tz => "Asia/Riyadh" },
2666 sbhir => { desc => "Guadalcanal, Solomon Islands", tz => "Pacific/Guadalcanal" },
2667 scmaw => { desc => "Mah\xE9, Seychelles", tz => "Indian/Mahe" },
2668 sdkrt => { desc => "Khartoum, Sudan", tz => "Africa/Khartoum" },
2669 sesto => { desc => "Stockholm, Sweden", tz => "Europe/Stockholm" },
2670 sgsin => {
2671 alias => [qw( Asia/Singapore Singapore )],
2672 desc => "Singapore",
2673 tz => "Asia/Singapore",
2674 },
2675 shshn => { desc => "Saint Helena", tz => "Atlantic/St_Helena" },
2676 silju => { desc => "Ljubljana, Slovenia", tz => "Europe/Ljubljana" },
2677 sjlyr => {
2678 alias => [qw( Arctic/Longyearbyen Atlantic/Jan_Mayen )],
2679 desc => "Longyearbyen, Svalbard",
2680 tz => "Arctic/Longyearbyen",
2681 },
2682 skbts => { desc => "Bratislava, Slovakia", tz => "Europe/Bratislava" },
2683 slfna => { desc => "Freetown, Sierra Leone", tz => "Africa/Freetown" },
2684 smsai => { desc => "San Marino", tz => "Europe/San_Marino" },
2685 sndkr => { desc => "Dakar, Senegal", tz => "Africa/Dakar" },
2686 somgq => { desc => "Mogadishu, Somalia", tz => "Africa/Mogadishu" },
2687 srpbm => { desc => "Paramaribo, Suriname", tz => "America/Paramaribo" },
2688 ssjub => { desc => "Juba, South Sudan", tz => "Africa/Juba" },
2689 sttms => {
2690 desc => "S\xE3o Tom\xE9, S\xE3o Tom\xE9 and Pr\xEDncipe",
2691 tz => "Africa/Sao_Tome",
2692 },
2693 svsal => { desc => "El Salvador", tz => "America/El_Salvador" },
2694 sxphi => { desc => "Sint Maarten", tz => "America/Lower_Princes" },
2695 sydam => { desc => "Damascus, Syria", tz => "Asia/Damascus" },
2696 szqmn => { desc => "Mbabane, Swaziland", tz => "Africa/Mbabane" },
2697 tcgdt => {
2698 desc => "Grand Turk, Turks and Caicos Islands",
2699 tz => "America/Grand_Turk",
2700 },
2701 tdndj => { desc => "N'Djamena, Chad", tz => "Africa/Ndjamena" },
2702 tfpfr => {
2703 desc => "Kerguelen Islands, French Southern Territories",
2704 tz => "Indian/Kerguelen",
2705 },
2706 tglfw => { desc => "Lom\xE9, Togo", tz => "Africa/Lome" },
2707 thbkk => { desc => "Bangkok, Thailand", tz => "Asia/Bangkok" },
2708 tjdyu => { desc => "Dushanbe, Tajikistan", tz => "Asia/Dushanbe" },
2709 tkfko => { desc => "Fakaofo, Tokelau", tz => "Pacific/Fakaofo" },
2710 tldil => { desc => "Dili, East Timor", tz => "Asia/Dili" },
2711 tmasb => {
2712 alias => [qw( Asia/Ashgabat Asia/Ashkhabad )],
2713 desc => "Ashgabat, Turkmenistan",
2714 tz => "Asia/Ashgabat",
2715 },
2716 tntun => { desc => "Tunis, Tunisia", tz => "Africa/Tunis" },
2717 totbu => { desc => "Tongatapu, Tonga", tz => "Pacific/Tongatapu" },
2718 trist => {
2719 alias => [qw( Europe/Istanbul Asia/Istanbul Turkey )],
2720 desc => "Istanbul, T\xFCrkiye",
2721 tz => "Europe/Istanbul",
2722 },
2723 ttpos => {
2724 desc => "Port of Spain, Trinidad and Tobago",
2725 tz => "America/Port_of_Spain",
2726 },
2727 tvfun => { desc => "Funafuti, Tuvalu", tz => "Pacific/Funafuti" },
2728 twtpe => {
2729 alias => [qw( Asia/Taipei ROC )],
2730 desc => "Taipei, Taiwan",
2731 tz => "Asia/Taipei",
2732 },
2733 tzdar => { desc => "Dar es Salaam, Tanzania", tz => "Africa/Dar_es_Salaam" },
2734 uaiev => {
2735 alias => [qw( Europe/Kiev Europe/Kyiv Europe/Zaporozhye Europe/Uzhgorod )],
2736 desc => "Kyiv, Ukraine",
2737 tz => "Europe/Kyiv",
2738 },
2739 uaozh => {
2740 deprecated => 1,
2741 desc => "Zaporizhia (Zaporozhye), Ukraine",
2742 preferred => "uaiev",
2743 },
2744 uasip => { desc => "Simferopol, Ukraine", tz => "Europe/Simferopol" },
2745 uauzh => {
2746 deprecated => 1,
2747 desc => "Uzhhorod (Uzhgorod), Ukraine",
2748 preferred => "uaiev",
2749 },
2750 ugkla => { desc => "Kampala, Uganda", tz => "Africa/Kampala" },
2751 umawk => {
2752 desc => "Wake Island, U.S. Minor Outlying Islands",
2753 tz => "Pacific/Wake",
2754 },
2755 umjon => {
2756 deprecated => 1,
2757 desc => "Johnston Atoll, U.S. Minor Outlying Islands",
2758 preferred => "ushnl",
2759 },
2760 ummdy => {
2761 desc => "Midway Islands, U.S. Minor Outlying Islands",
2762 tz => "Pacific/Midway",
2763 },
2764 unk => { desc => "Unknown time zone", tz => "Etc/Unknown" },
2765 usadk => {
2766 alias => [qw( America/Adak America/Atka US/Aleutian )],
2767 desc => "Adak (Alaska), United States",
2768 tz => "America/Adak",
2769 },
2770 usaeg => {
2771 desc => "Marengo (Indiana), United States",
2772 tz => "America/Indiana/Marengo",
2773 },
2774 usanc => {
2775 alias => [qw( America/Anchorage US/Alaska )],
2776 desc => "Anchorage, United States",
2777 tz => "America/Anchorage",
2778 },
2779 usboi => { desc => "Boise (Idaho), United States", tz => "America/Boise" },
2780 uschi => {
2781 alias => [qw( America/Chicago US/Central )],
2782 desc => "Chicago, United States",
2783 tz => "America/Chicago",
2784 },
2785 usden => {
2786 alias => [qw( America/Denver America/Shiprock Navajo US/Mountain )],
2787 desc => "Denver, United States",
2788 tz => "America/Denver",
2789 },
2790 usdet => {
2791 alias => [qw( America/Detroit US/Michigan )],
2792 desc => "Detroit, United States",
2793 tz => "America/Detroit",
2794 },
2795 ushnl => {
2796 alias => [qw( Pacific/Honolulu US/Hawaii Pacific/Johnston )],
2797 desc => "Honolulu, United States",
2798 tz => "Pacific/Honolulu",
2799 },
2800 usind => {
2801 alias => [qw(
2802 America/Indianapolis America/Fort_Wayne
2803 America/Indiana/Indianapolis US/East-Indiana
2804 )],
2805 desc => "Indianapolis, United States",
2806 tz => "America/Indiana/Indianapolis",
2807 },
2808 usinvev => {
2809 desc => "Vevay (Indiana), United States",
2810 tz => "America/Indiana/Vevay",
2811 },
2812 usjnu => { desc => "Juneau (Alaska), United States", tz => "America/Juneau" },
2813 usknx => {
2814 alias => [qw( America/Indiana/Knox America/Knox_IN US/Indiana-Starke )],
2815 desc => "Knox (Indiana), United States",
2816 tz => "America/Indiana/Knox",
2817 },
2818 uslax => {
2819 alias => [qw( America/Los_Angeles US/Pacific US/Pacific-New )],
2820 desc => "Los Angeles, United States",
2821 tz => "America/Los_Angeles",
2822 },
2823 uslui => {
2824 alias => [qw( America/Louisville America/Kentucky/Louisville )],
2825 desc => "Louisville (Kentucky), United States",
2826 tz => "America/Kentucky/Louisville",
2827 },
2828 usmnm => {
2829 desc => "Menominee (Michigan), United States",
2830 tz => "America/Menominee",
2831 },
2832 usmoc => {
2833 desc => "Monticello (Kentucky), United States",
2834 tz => "America/Kentucky/Monticello",
2835 },
2836 usmtm => {
2837 desc => "Metlakatla (Alaska), United States",
2838 tz => "America/Metlakatla",
2839 },
2840 usnavajo => {
2841 deprecated => 1,
2842 desc => "Shiprock (Navajo), United States",
2843 preferred => "usden",
2844 },
2845 usndcnt => {
2846 desc => "Center (North Dakota), United States",
2847 tz => "America/North_Dakota/Center",
2848 },
2849 usndnsl => {
2850 desc => "New Salem (North Dakota), United States",
2851 tz => "America/North_Dakota/New_Salem",
2852 },
2853 usnyc => {
2854 alias => [qw( America/New_York US/Eastern )],
2855 desc => "New York, United States",
2856 tz => "America/New_York",
2857 },
2858 usoea => {
2859 desc => "Vincennes (Indiana), United States",
2860 tz => "America/Indiana/Vincennes",
2861 },
2862 usome => { desc => "Nome (Alaska), United States", tz => "America/Nome" },
2863 usphx => {
2864 alias => [qw( America/Phoenix US/Arizona )],
2865 desc => "Phoenix, United States",
2866 tz => "America/Phoenix",
2867 },
2868 ussit => { desc => "Sitka (Alaska), United States", tz => "America/Sitka" },
2869 ustel => {
2870 desc => "Tell City (Indiana), United States",
2871 tz => "America/Indiana/Tell_City",
2872 },
2873 uswlz => {
2874 desc => "Winamac (Indiana), United States",
2875 tz => "America/Indiana/Winamac",
2876 },
2877 uswsq => {
2878 desc => "Petersburg (Indiana), United States",
2879 tz => "America/Indiana/Petersburg",
2880 },
2881 usxul => {
2882 desc => "Beulah (North Dakota), United States",
2883 tz => "America/North_Dakota/Beulah",
2884 },
2885 usyak => { desc => "Yakutat (Alaska), United States", tz => "America/Yakutat" },
2886 utc => {
2887 alias => [qw(
2888 Etc/UTC Etc/UCT Etc/Universal Etc/Zulu UCT UTC Universal
2889 Zulu
2890 )],
2891 desc => "UTC (Coordinated Universal Time)",
2892 tz => "Etc/UTC",
2893 },
2894 utce01 => { desc => "1 hour ahead of UTC", tz => "Etc/GMT-1" },
2895 utce02 => { desc => "2 hours ahead of UTC", tz => "Etc/GMT-2" },
2896 utce03 => { desc => "3 hours ahead of UTC", tz => "Etc/GMT-3" },
2897 utce04 => { desc => "4 hours ahead of UTC", tz => "Etc/GMT-4" },
2898 utce05 => { desc => "5 hours ahead of UTC", tz => "Etc/GMT-5" },
2899 utce06 => { desc => "6 hours ahead of UTC", tz => "Etc/GMT-6" },
2900 utce07 => { desc => "7 hours ahead of UTC", tz => "Etc/GMT-7" },
2901 utce08 => { desc => "8 hours ahead of UTC", tz => "Etc/GMT-8" },
2902 utce09 => { desc => "9 hours ahead of UTC", tz => "Etc/GMT-9" },
2903 utce10 => { desc => "10 hours ahead of UTC", tz => "Etc/GMT-10" },
2904 utce11 => { desc => "11 hours ahead of UTC", tz => "Etc/GMT-11" },
2905 utce12 => { desc => "12 hours ahead of UTC", tz => "Etc/GMT-12" },
2906 utce13 => { desc => "13 hours ahead of UTC", tz => "Etc/GMT-13" },
2907 utce14 => { desc => "14 hours ahead of UTC", tz => "Etc/GMT-14" },
2908 utcw01 => { desc => "1 hour behind UTC", tz => "Etc/GMT+1" },
2909 utcw02 => { desc => "2 hours behind UTC", tz => "Etc/GMT+2" },
2910 utcw03 => { desc => "3 hours behind UTC", tz => "Etc/GMT+3" },
2911 utcw04 => { desc => "4 hours behind UTC", tz => "Etc/GMT+4" },
2912 utcw05 => {
2913 alias => [qw( Etc/GMT+5 EST )],
2914 desc => "5 hours behind UTC",
2915 tz => "Etc/GMT+5",
2916 },
2917 utcw06 => { desc => "6 hours behind UTC", tz => "Etc/GMT+6" },
2918 utcw07 => {
2919 alias => [qw( Etc/GMT+7 MST )],
2920 desc => "7 hours behind UTC",
2921 tz => "Etc/GMT+7",
2922 },
2923 utcw08 => { desc => "8 hours behind UTC", tz => "Etc/GMT+8" },
2924 utcw09 => { desc => "9 hours behind UTC", tz => "Etc/GMT+9" },
2925 utcw10 => {
2926 alias => [qw( Etc/GMT+10 HST )],
2927 desc => "10 hours behind UTC",
2928 tz => "Etc/GMT+10",
2929 },
2930 utcw11 => { desc => "11 hours behind UTC", tz => "Etc/GMT+11" },
2931 utcw12 => { desc => "12 hours behind UTC", tz => "Etc/GMT+12" },
2932 uymvd => { desc => "Montevideo, Uruguay", tz => "America/Montevideo" },
2933 uzskd => { desc => "Samarkand, Uzbekistan", tz => "Asia/Samarkand" },
2934 uztas => { desc => "Tashkent, Uzbekistan", tz => "Asia/Tashkent" },
2935 vavat => { desc => "Vatican City", tz => "Europe/Vatican" },
2936 vcsvd => {
2937 desc => "Saint Vincent, Saint Vincent and the Grenadines",
2938 tz => "America/St_Vincent",
2939 },
2940 veccs => { desc => "Caracas, Venezuela", tz => "America/Caracas" },
2941 vgtov => { desc => "Tortola, British Virgin Islands", tz => "America/Tortola" },
2942 vistt => {
2943 alias => [qw( America/St_Thomas America/Virgin )],
2944 desc => "Saint Thomas, U.S. Virgin Islands",
2945 tz => "America/St_Thomas",
2946 },
2947 vnsgn => {
2948 alias => [qw( Asia/Saigon Asia/Ho_Chi_Minh )],
2949 desc => "Ho Chi Minh City, Vietnam",
2950 tz => "Asia/Ho_Chi_Minh",
2951 },
2952 vuvli => { desc => "Efate, Vanuatu", tz => "Pacific/Efate" },
2953 wfmau => { desc => "Wallis Islands, Wallis and Futuna", tz => "Pacific/Wallis" },
2954 wsapw => { desc => "Apia, Samoa", tz => "Pacific/Apia" },
2955 yeade => { desc => "Aden, Yemen", tz => "Asia/Aden" },
2956 ytmam => { desc => "Mayotte", tz => "Indian/Mayotte" },
2957 zajnb => { desc => "Johannesburg, South Africa", tz => "Africa/Johannesburg" },
2958 zmlun => { desc => "Lusaka, Zambia", tz => "Africa/Lusaka" },
2959 zwhre => { desc => "Harare, Zimbabwe", tz => "Africa/Harare" },
2960 };
2961  
2962 # NOTE: $TZ_NAME2ID
2963 # This BCP47 timezone database is different from the Olson IANA database in that it keeps old record for reliability and consistency.
2964 # See <https://github.com/unicode-org/cldr/blob/main/common/bcp47/timezone.xml>
2965 # <https://www.iana.org/time-zones>
2966 # <ftp://ftp.iana.org/tz/releases/>
2967 3 $TZ_NAME2ID =
2968 {
2969 "Africa/Abidjan" => "ciabj",
2970 "Africa/Accra" => "ghacc",
2971 "Africa/Addis_Ababa" => "etadd",
2972 "Africa/Algiers" => "dzalg",
2973 "Africa/Asmara" => "erasm",
2974 "Africa/Asmera" => "erasm",
2975 "Africa/Bamako" => "mlbko",
2976 "Africa/Bangui" => "cfbgf",
2977 "Africa/Banjul" => "gmbjl",
2978 "Africa/Bissau" => "gwoxb",
2979 "Africa/Blantyre" => "mwblz",
2980 "Africa/Brazzaville" => "cgbzv",
2981 "Africa/Bujumbura" => "bibjm",
2982 "Africa/Cairo" => "egcai",
2983 "Africa/Casablanca" => "macas",
2984 "Africa/Ceuta" => "esceu",
2985 "Africa/Conakry" => "gncky",
2986 "Africa/Dakar" => "sndkr",
2987 "Africa/Dar_es_Salaam" => "tzdar",
2988 "Africa/Djibouti" => "djjib",
2989 "Africa/Douala" => "cmdla",
2990 "Africa/El_Aaiun" => "eheai",
2991 "Africa/Freetown" => "slfna",
2992 "Africa/Gaborone" => "bwgbe",
2993 "Africa/Harare" => "zwhre",
2994 "Africa/Johannesburg" => "zajnb",
2995 "Africa/Juba" => "ssjub",
2996 "Africa/Kampala" => "ugkla",
2997 "Africa/Khartoum" => "sdkrt",
2998 "Africa/Kigali" => "rwkgl",
2999 "Africa/Kinshasa" => "cdfih",
3000 "Africa/Lagos" => "nglos",
3001 "Africa/Libreville" => "galbv",
3002 "Africa/Lome" => "tglfw",
3003 "Africa/Luanda" => "aolad",
3004 "Africa/Lubumbashi" => "cdfbm",
3005 "Africa/Lusaka" => "zmlun",
3006 "Africa/Malabo" => "gqssg",
3007 "Africa/Maputo" => "mzmpm",
3008 "Africa/Maseru" => "lsmsu",
3009 "Africa/Mbabane" => "szqmn",
3010 "Africa/Mogadishu" => "somgq",
3011 "Africa/Monrovia" => "lrmlw",
3012 "Africa/Nairobi" => "kenbo",
3013 "Africa/Ndjamena" => "tdndj",
3014 "Africa/Niamey" => "nenim",
3015 "Africa/Nouakchott" => "mrnkc",
3016 "Africa/Ouagadougou" => "bfoua",
3017 "Africa/Porto-Novo" => "bjptn",
3018 "Africa/Sao_Tome" => "sttms",
3019 "Africa/Timbuktu" => "mlbko",
3020 "Africa/Tripoli" => "lytip",
3021 "Africa/Tunis" => "tntun",
3022 "Africa/Windhoek" => "nawdh",
3023 "America/Adak" => "usadk",
3024 "America/Anchorage" => "usanc",
3025 "America/Anguilla" => "aiaxa",
3026 "America/Antigua" => "aganu",
3027 "America/Araguaina" => "braux",
3028 "America/Argentina/Buenos_Aires" => "arbue",
3029 "America/Argentina/Catamarca" => "arctc",
3030 "America/Argentina/ComodRivadavia" => "arctc",
3031 "America/Argentina/Cordoba" => "arcor",
3032 "America/Argentina/Jujuy" => "arjuj",
3033 "America/Argentina/La_Rioja" => "arirj",
3034 "America/Argentina/Mendoza" => "armdz",
3035 "America/Argentina/Rio_Gallegos" => "arrgl",
3036 "America/Argentina/Salta" => "arsla",
3037 "America/Argentina/San_Juan" => "aruaq",
3038 "America/Argentina/San_Luis" => "arluq",
3039 "America/Argentina/Tucuman" => "artuc",
3040 "America/Argentina/Ushuaia" => "arush",
3041 "America/Aruba" => "awaua",
3042 "America/Asuncion" => "pyasu",
3043 "America/Atikokan" => "cayzs",
3044 "America/Atka" => "usadk",
3045 "America/Bahia" => "brssa",
3046 "America/Bahia_Banderas" => "mxpvr",
3047 "America/Barbados" => "bbbgi",
3048 "America/Belem" => "brbel",
3049 "America/Belize" => "bzbze",
3050 "America/Blanc-Sablon" => "caybx",
3051 "America/Boa_Vista" => "brbvb",
3052 "America/Bogota" => "cobog",
3053 "America/Boise" => "usboi",
3054 "America/Buenos_Aires" => "arbue",
3055 "America/Cambridge_Bay" => "caycb",
3056 "America/Campo_Grande" => "brcgr",
3057 "America/Cancun" => "mxcun",
3058 "America/Caracas" => "veccs",
3059 "America/Catamarca" => "arctc",
3060 "America/Cayenne" => "gfcay",
3061 "America/Cayman" => "kygec",
3062 "America/Chicago" => "uschi",
3063 "America/Chihuahua" => "mxchi",
3064 "America/Ciudad_Juarez" => "mxcjs",
3065 "America/Coral_Harbour" => "cayzs",
3066 "America/Cordoba" => "arcor",
3067 "America/Costa_Rica" => "crsjo",
3068 "America/Creston" => "cacfq",
3069 "America/Cuiaba" => "brcgb",
3070 "America/Curacao" => "ancur",
3071 "America/Danmarkshavn" => "gldkshvn",
3072 "America/Dawson" => "cayda",
3073 "America/Dawson_Creek" => "caydq",
3074 "America/Denver" => "usden",
3075 "America/Detroit" => "usdet",
3076 "America/Dominica" => "dmdom",
3077 "America/Edmonton" => "caedm",
3078 "America/Eirunepe" => "brern",
3079 "America/El_Salvador" => "svsal",
3080 "America/Ensenada" => "mxtij",
3081 "America/Fort_Nelson" => "cafne",
3082 "America/Fort_Wayne" => "usind",
3083 "America/Fortaleza" => "brfor",
3084 "America/Glace_Bay" => "caglb",
3085 "America/Godthab" => "glgoh",
3086 "America/Goose_Bay" => "cagoo",
3087 "America/Grand_Turk" => "tcgdt",
3088 "America/Grenada" => "gdgnd",
3089 "America/Guadeloupe" => "gpbbr",
3090 "America/Guatemala" => "gtgua",
3091 "America/Guayaquil" => "ecgye",
3092 "America/Guyana" => "gygeo",
3093 "America/Halifax" => "cahal",
3094 "America/Havana" => "cuhav",
3095 "America/Hermosillo" => "mxhmo",
3096 "America/Indiana/Indianapolis" => "usind",
3097 "America/Indiana/Knox" => "usknx",
3098 "America/Indiana/Marengo" => "usaeg",
3099 "America/Indiana/Petersburg" => "uswsq",
3100 "America/Indiana/Tell_City" => "ustel",
3101 "America/Indiana/Vevay" => "usinvev",
3102 "America/Indiana/Vincennes" => "usoea",
3103 "America/Indiana/Winamac" => "uswlz",
3104 "America/Indianapolis" => "usind",
3105 "America/Inuvik" => "cayev",
3106 "America/Iqaluit" => "caiql",
3107 "America/Jamaica" => "jmkin",
3108 "America/Jujuy" => "arjuj",
3109 "America/Juneau" => "usjnu",
3110 "America/Kentucky/Louisville" => "uslui",
3111 "America/Kentucky/Monticello" => "usmoc",
3112 "America/Knox_IN" => "usknx",
3113 "America/Kralendijk" => "bqkra",
3114 "America/La_Paz" => "bolpb",
3115 "America/Lima" => "pelim",
3116 "America/Los_Angeles" => "uslax",
3117 "America/Louisville" => "uslui",
3118 "America/Lower_Princes" => "sxphi",
3119 "America/Maceio" => "brmcz",
3120 "America/Managua" => "nimga",
3121 "America/Manaus" => "brmao",
3122 "America/Marigot" => "gpmsb",
3123 "America/Martinique" => "mqfdf",
3124 "America/Matamoros" => "mxmam",
3125 "America/Mazatlan" => "mxmzt",
3126 "America/Mendoza" => "armdz",
3127 "America/Menominee" => "usmnm",
3128 "America/Merida" => "mxmid",
3129 "America/Metlakatla" => "usmtm",
3130 "America/Mexico_City" => "mxmex",
3131 "America/Miquelon" => "pmmqc",
3132 "America/Moncton" => "camon",
3133 "America/Monterrey" => "mxmty",
3134 "America/Montevideo" => "uymvd",
3135 "America/Montreal" => "cator",
3136 "America/Montserrat" => "msmni",
3137 "America/Nassau" => "bsnas",
3138 "America/New_York" => "usnyc",
3139 "America/Nipigon" => "cator",
3140 "America/Nome" => "usome",
3141 "America/Noronha" => "brfen",
3142 "America/North_Dakota/Beulah" => "usxul",
3143 "America/North_Dakota/Center" => "usndcnt",
3144 "America/North_Dakota/New_Salem" => "usndnsl",
3145 "America/Nuuk" => "glgoh",
3146 "America/Ojinaga" => "mxoji",
3147 "America/Panama" => "papty",
3148 "America/Pangnirtung" => "caiql",
3149 "America/Paramaribo" => "srpbm",
3150 "America/Phoenix" => "usphx",
3151 "America/Port-au-Prince" => "htpap",
3152 "America/Port_of_Spain" => "ttpos",
3153 "America/Porto_Acre" => "brrbr",
3154 "America/Porto_Velho" => "brpvh",
3155 "America/Puerto_Rico" => "prsju",
3156 "America/Punta_Arenas" => "clpuq",
3157 "America/Rainy_River" => "cawnp",
3158 "America/Rankin_Inlet" => "cayek",
3159 "America/Recife" => "brrec",
3160 "America/Regina" => "careg",
3161 "America/Resolute" => "careb",
3162 "America/Rio_Branco" => "brrbr",
3163 "America/Rosario" => "arcor",
3164 "America/Santa_Isabel" => "mxtij",
3165 "America/Santarem" => "brstm",
3166 "America/Santiago" => "clscl",
3167 "America/Santo_Domingo" => "dosdq",
3168 "America/Sao_Paulo" => "brsao",
3169 "America/Scoresbysund" => "globy",
3170 "America/Shiprock" => "usden",
3171 "America/Sitka" => "ussit",
3172 "America/St_Barthelemy" => "gpsbh",
3173 "America/St_Johns" => "casjf",
3174 "America/St_Kitts" => "knbas",
3175 "America/St_Lucia" => "lccas",
3176 "America/St_Thomas" => "vistt",
3177 "America/St_Vincent" => "vcsvd",
3178 "America/Swift_Current" => "cayyn",
3179 "America/Tegucigalpa" => "hntgu",
3180 "America/Thule" => "glthu",
3181 "America/Thunder_Bay" => "cator",
3182 "America/Tijuana" => "mxtij",
3183 "America/Toronto" => "cator",
3184 "America/Tortola" => "vgtov",
3185 "America/Vancouver" => "cavan",
3186 "America/Virgin" => "vistt",
3187 "America/Whitehorse" => "cayxy",
3188 "America/Winnipeg" => "cawnp",
3189 "America/Yakutat" => "usyak",
3190 "America/Yellowknife" => "caedm",
3191 "Antarctica/Casey" => "aqcas",
3192 "Antarctica/Davis" => "aqdav",
3193 "Antarctica/DumontDUrville" => "aqddu",
3194 "Antarctica/Macquarie" => "aumqi",
3195 "Antarctica/Mawson" => "aqmaw",
3196 "Antarctica/McMurdo" => "aqmcm",
3197 "Antarctica/Palmer" => "aqplm",
3198 "Antarctica/Rothera" => "aqrot",
3199 "Antarctica/South_Pole" => "nzakl",
3200 "Antarctica/Syowa" => "aqsyw",
3201 "Antarctica/Troll" => "aqtrl",
3202 "Antarctica/Vostok" => "aqvos",
3203 "Arctic/Longyearbyen" => "sjlyr",
3204 "Asia/Aden" => "yeade",
3205 "Asia/Almaty" => "kzala",
3206 "Asia/Amman" => "joamm",
3207 "Asia/Anadyr" => "rudyr",
3208 "Asia/Aqtau" => "kzaau",
3209 "Asia/Aqtobe" => "kzakx",
3210 "Asia/Ashgabat" => "tmasb",
3211 "Asia/Ashkhabad" => "tmasb",
3212 "Asia/Atyrau" => "kzguw",
3213 "Asia/Baghdad" => "iqbgw",
3214 "Asia/Bahrain" => "bhbah",
3215 "Asia/Baku" => "azbak",
3216 "Asia/Bangkok" => "thbkk",
3217 "Asia/Barnaul" => "rubax",
3218 "Asia/Beirut" => "lbbey",
3219 "Asia/Bishkek" => "kgfru",
3220 "Asia/Brunei" => "bnbwn",
3221 "Asia/Calcutta" => "inccu",
3222 "Asia/Chita" => "ruchita",
3223 "Asia/Choibalsan" => "mncoq",
3224 "Asia/Chongqing" => "cnsha",
3225 "Asia/Chungking" => "cnsha",
3226 "Asia/Colombo" => "lkcmb",
3227 "Asia/Dacca" => "bddac",
3228 "Asia/Damascus" => "sydam",
3229 "Asia/Dhaka" => "bddac",
3230 "Asia/Dili" => "tldil",
3231 "Asia/Dubai" => "aedxb",
3232 "Asia/Dushanbe" => "tjdyu",
3233 "Asia/Famagusta" => "cyfmg",
3234 "Asia/Gaza" => "gazastrp",
3235 "Asia/Harbin" => "cnsha",
3236 "Asia/Hebron" => "hebron",
3237 "Asia/Ho_Chi_Minh" => "vnsgn",
3238 "Asia/Hong_Kong" => "hkhkg",
3239 "Asia/Hovd" => "mnhvd",
3240 "Asia/Irkutsk" => "ruikt",
3241 "Asia/Istanbul" => "trist",
3242 "Asia/Jakarta" => "idjkt",
3243 "Asia/Jayapura" => "iddjj",
3244 "Asia/Jerusalem" => "jeruslm",
3245 "Asia/Kabul" => "afkbl",
3246 "Asia/Kamchatka" => "rupkc",
3247 "Asia/Karachi" => "pkkhi",
3248 "Asia/Kashgar" => "cnurc",
3249 "Asia/Kathmandu" => "npktm",
3250 "Asia/Katmandu" => "npktm",
3251 "Asia/Khandyga" => "rukhndg",
3252 "Asia/Kolkata" => "inccu",
3253 "Asia/Krasnoyarsk" => "rukra",
3254 "Asia/Kuala_Lumpur" => "mykul",
3255 "Asia/Kuching" => "mykch",
3256 "Asia/Kuwait" => "kwkwi",
3257 "Asia/Macao" => "momfm",
3258 "Asia/Macau" => "momfm",
3259 "Asia/Magadan" => "rugdx",
3260 "Asia/Makassar" => "idmak",
3261 "Asia/Manila" => "phmnl",
3262 "Asia/Muscat" => "ommct",
3263 "Asia/Nicosia" => "cynic",
3264 "Asia/Novokuznetsk" => "runoz",
3265 "Asia/Novosibirsk" => "ruovb",
3266 "Asia/Omsk" => "ruoms",
3267 "Asia/Oral" => "kzura",
3268 "Asia/Phnom_Penh" => "khpnh",
3269 "Asia/Pontianak" => "idpnk",
3270 "Asia/Pyongyang" => "kpfnj",
3271 "Asia/Qatar" => "qadoh",
3272 "Asia/Qostanay" => "kzksn",
3273 "Asia/Qyzylorda" => "kzkzo",
3274 "Asia/Rangoon" => "mmrgn",
3275 "Asia/Riyadh" => "saruh",
3276 "Asia/Saigon" => "vnsgn",
3277 "Asia/Sakhalin" => "ruuus",
3278 "Asia/Samarkand" => "uzskd",
3279 "Asia/Seoul" => "krsel",
3280 "Asia/Shanghai" => "cnsha",
3281 "Asia/Singapore" => "sgsin",
3282 "Asia/Srednekolymsk" => "rusred",
3283 "Asia/Taipei" => "twtpe",
3284 "Asia/Tashkent" => "uztas",
3285 "Asia/Tbilisi" => "getbs",
3286 "Asia/Tehran" => "irthr",
3287 "Asia/Tel_Aviv" => "jeruslm",
3288 "Asia/Thimbu" => "btthi",
3289 "Asia/Thimphu" => "btthi",
3290 "Asia/Tokyo" => "jptyo",
3291 "Asia/Tomsk" => "rutof",
3292 "Asia/Ujung_Pandang" => "idmak",
3293 "Asia/Ulaanbaatar" => "mnuln",
3294 "Asia/Ulan_Bator" => "mnuln",
3295 "Asia/Urumqi" => "cnurc",
3296 "Asia/Ust-Nera" => "ruunera",
3297 "Asia/Vientiane" => "lavte",
3298 "Asia/Vladivostok" => "ruvvo",
3299 "Asia/Yakutsk" => "ruyks",
3300 "Asia/Yangon" => "mmrgn",
3301 "Asia/Yekaterinburg" => "ruyek",
3302 "Asia/Yerevan" => "amevn",
3303 "Atlantic/Azores" => "ptpdl",
3304 "Atlantic/Bermuda" => "bmbda",
3305 "Atlantic/Canary" => "eslpa",
3306 "Atlantic/Cape_Verde" => "cvrai",
3307 "Atlantic/Faeroe" => "fotho",
3308 "Atlantic/Faroe" => "fotho",
3309 "Atlantic/Jan_Mayen" => "sjlyr",
3310 "Atlantic/Madeira" => "ptfnc",
3311 "Atlantic/Reykjavik" => "isrey",
3312 "Atlantic/South_Georgia" => "gsgrv",
3313 "Atlantic/St_Helena" => "shshn",
3314 "Atlantic/Stanley" => "fkpsy",
3315 "Australia/ACT" => "ausyd",
3316 "Australia/Adelaide" => "auadl",
3317 "Australia/Brisbane" => "aubne",
3318 "Australia/Broken_Hill" => "aubhq",
3319 "Australia/Canberra" => "ausyd",
3320 "Australia/Currie" => "auhba",
3321 "Australia/Darwin" => "audrw",
3322 "Australia/Eucla" => "aueuc",
3323 "Australia/Hobart" => "auhba",
3324 "Australia/LHI" => "auldh",
3325 "Australia/Lindeman" => "auldc",
3326 "Australia/Lord_Howe" => "auldh",
3327 "Australia/Melbourne" => "aumel",
3328 "Australia/North" => "audrw",
3329 "Australia/NSW" => "ausyd",
3330 "Australia/Perth" => "auper",
3331 "Australia/Queensland" => "aubne",
3332 "Australia/South" => "auadl",
3333 "Australia/Sydney" => "ausyd",
3334 "Australia/Tasmania" => "auhba",
3335 "Australia/Victoria" => "aumel",
3336 "Australia/West" => "auper",
3337 "Australia/Yancowinna" => "aubhq",
3338 "Brazil/Acre" => "brrbr",
3339 "Brazil/DeNoronha" => "brfen",
3340 "Brazil/East" => "brsao",
3341 "Brazil/West" => "brmao",
3342 "Canada/Atlantic" => "cahal",
3343 "Canada/Central" => "cawnp",
3344 "Canada/East-Saskatchewan" => "careg",
3345 "Canada/Eastern" => "cator",
3346 "Canada/Mountain" => "caedm",
3347 "Canada/Newfoundland" => "casjf",
3348 "Canada/Pacific" => "cavan",
3349 "Canada/Saskatchewan" => "careg",
3350 "Canada/Yukon" => "cayxy",
3351 "Chile/Continental" => "clscl",
3352 "Chile/EasterIsland" => "clipc",
3353 CST6CDT => "cst6cdt",
3354 Cuba => "cuhav",
3355 Egypt => "egcai",
3356 Eire => "iedub",
3357 EST => "utcw05",
3358 EST5EDT => "est5edt",
3359 "Etc/GMT" => "gmt",
3360 "Etc/GMT+0" => "gmt",
3361 "Etc/GMT+1" => "utcw01",
3362 "Etc/GMT+10" => "utcw10",
3363 "Etc/GMT+11" => "utcw11",
3364 "Etc/GMT+12" => "utcw12",
3365 "Etc/GMT+2" => "utcw02",
3366 "Etc/GMT+3" => "utcw03",
3367 "Etc/GMT+4" => "utcw04",
3368 "Etc/GMT+5" => "utcw05",
3369 "Etc/GMT+6" => "utcw06",
3370 "Etc/GMT+7" => "utcw07",
3371 "Etc/GMT+8" => "utcw08",
3372 "Etc/GMT+9" => "utcw09",
3373 "Etc/GMT-0" => "gmt",
3374 "Etc/GMT-1" => "utce01",
3375 "Etc/GMT-10" => "utce10",
3376 "Etc/GMT-11" => "utce11",
3377 "Etc/GMT-12" => "utce12",
3378 "Etc/GMT-13" => "utce13",
3379 "Etc/GMT-14" => "utce14",
3380 "Etc/GMT-2" => "utce02",
3381 "Etc/GMT-3" => "utce03",
3382 "Etc/GMT-4" => "utce04",
3383 "Etc/GMT-5" => "utce05",
3384 "Etc/GMT-6" => "utce06",
3385 "Etc/GMT-7" => "utce07",
3386 "Etc/GMT-8" => "utce08",
3387 "Etc/GMT-9" => "utce09",
3388 "Etc/GMT0" => "gmt",
3389 "Etc/Greenwich" => "gmt",
3390 "Etc/UCT" => "utc",
3391 "Etc/Universal" => "utc",
3392 "Etc/Unknown" => "unk",
3393 "Etc/UTC" => "utc",
3394 "Etc/Zulu" => "utc",
3395 "Europe/Amsterdam" => "nlams",
3396 "Europe/Andorra" => "adalv",
3397 "Europe/Astrakhan" => "ruasf",
3398 "Europe/Athens" => "grath",
3399 "Europe/Belfast" => "gblon",
3400 "Europe/Belgrade" => "rsbeg",
3401 "Europe/Berlin" => "deber",
3402 "Europe/Bratislava" => "skbts",
3403 "Europe/Brussels" => "bebru",
3404 "Europe/Bucharest" => "robuh",
3405 "Europe/Budapest" => "hubud",
3406 "Europe/Busingen" => "debsngn",
3407 "Europe/Chisinau" => "mdkiv",
3408 "Europe/Copenhagen" => "dkcph",
3409 "Europe/Dublin" => "iedub",
3410 "Europe/Gibraltar" => "gigib",
3411 "Europe/Guernsey" => "gggci",
3412 "Europe/Helsinki" => "fihel",
3413 "Europe/Isle_of_Man" => "imdgs",
3414 "Europe/Istanbul" => "trist",
3415 "Europe/Jersey" => "jesth",
3416 "Europe/Kaliningrad" => "rukgd",
3417 "Europe/Kiev" => "uaiev",
3418 "Europe/Kirov" => "rukvx",
3419 "Europe/Kyiv" => "uaiev",
3420 "Europe/Lisbon" => "ptlis",
3421 "Europe/Ljubljana" => "silju",
3422 "Europe/London" => "gblon",
3423 "Europe/Luxembourg" => "lulux",
3424 "Europe/Madrid" => "esmad",
3425 "Europe/Malta" => "mtmla",
3426 "Europe/Mariehamn" => "fimhq",
3427 "Europe/Minsk" => "bymsq",
3428 "Europe/Monaco" => "mcmon",
3429 "Europe/Moscow" => "rumow",
3430 "Europe/Nicosia" => "cynic",
3431 "Europe/Oslo" => "noosl",
3432 "Europe/Paris" => "frpar",
3433 "Europe/Podgorica" => "metgd",
3434 "Europe/Prague" => "czprg",
3435 "Europe/Riga" => "lvrix",
3436 "Europe/Rome" => "itrom",
3437 "Europe/Samara" => "rukuf",
3438 "Europe/San_Marino" => "smsai",
3439 "Europe/Sarajevo" => "basjj",
3440 "Europe/Saratov" => "rurtw",
3441 "Europe/Simferopol" => "uasip",
3442 "Europe/Skopje" => "mkskp",
3443 "Europe/Sofia" => "bgsof",
3444 "Europe/Stockholm" => "sesto",
3445 "Europe/Tallinn" => "eetll",
3446 "Europe/Tirane" => "altia",
3447 "Europe/Tiraspol" => "mdkiv",
3448 "Europe/Ulyanovsk" => "ruuly",
3449 "Europe/Uzhgorod" => "uaiev",
3450 "Europe/Vaduz" => "livdz",
3451 "Europe/Vatican" => "vavat",
3452 "Europe/Vienna" => "atvie",
3453 "Europe/Vilnius" => "ltvno",
3454 "Europe/Volgograd" => "ruvog",
3455 "Europe/Warsaw" => "plwaw",
3456 "Europe/Zagreb" => "hrzag",
3457 "Europe/Zaporozhye" => "uaiev",
3458 "Europe/Zurich" => "chzrh",
3459 GB => "gblon",
3460 "GB-Eire" => "gblon",
3461 GMT => "gmt",
3462 "GMT+0" => "gmt",
3463 "GMT-0" => "gmt",
3464 GMT0 => "gmt",
3465 Greenwich => "gmt",
3466 Hongkong => "hkhkg",
3467 HST => "utcw10",
3468 Iceland => "isrey",
3469 "Indian/Antananarivo" => "mgtnr",
3470 "Indian/Chagos" => "iodga",
3471 "Indian/Christmas" => "cxxch",
3472 "Indian/Cocos" => "cccck",
3473 "Indian/Comoro" => "kmyva",
3474 "Indian/Kerguelen" => "tfpfr",
3475 "Indian/Mahe" => "scmaw",
3476 "Indian/Maldives" => "mvmle",
3477 "Indian/Mauritius" => "muplu",
3478 "Indian/Mayotte" => "ytmam",
3479 "Indian/Reunion" => "rereu",
3480 Iran => "irthr",
3481 Israel => "jeruslm",
3482 Jamaica => "jmkin",
3483 Japan => "jptyo",
3484 Kwajalein => "mhkwa",
3485 Libya => "lytip",
3486 "Mexico/BajaNorte" => "mxtij",
3487 "Mexico/BajaSur" => "mxmzt",
3488 "Mexico/General" => "mxmex",
3489 MST => "utcw07",
3490 MST7MDT => "mst7mdt",
3491 Navajo => "usden",
3492 NZ => "nzakl",
3493 "NZ-CHAT" => "nzcht",
3494 "Pacific/Apia" => "wsapw",
3495 "Pacific/Auckland" => "nzakl",
3496 "Pacific/Bougainville" => "pgraw",
3497 "Pacific/Chatham" => "nzcht",
3498 "Pacific/Chuuk" => "fmtkk",
3499 "Pacific/Easter" => "clipc",
3500 "Pacific/Efate" => "vuvli",
3501 "Pacific/Enderbury" => "kipho",
3502 "Pacific/Fakaofo" => "tkfko",
3503 "Pacific/Fiji" => "fjsuv",
3504 "Pacific/Funafuti" => "tvfun",
3505 "Pacific/Galapagos" => "ecgps",
3506 "Pacific/Gambier" => "pfgmr",
3507 "Pacific/Guadalcanal" => "sbhir",
3508 "Pacific/Guam" => "gugum",
3509 "Pacific/Honolulu" => "ushnl",
3510 "Pacific/Johnston" => "ushnl",
3511 "Pacific/Kanton" => "kipho",
3512 "Pacific/Kiritimati" => "kicxi",
3513 "Pacific/Kosrae" => "fmksa",
3514 "Pacific/Kwajalein" => "mhkwa",
3515 "Pacific/Majuro" => "mhmaj",
3516 "Pacific/Marquesas" => "pfnhv",
3517 "Pacific/Midway" => "ummdy",
3518 "Pacific/Nauru" => "nrinu",
3519 "Pacific/Niue" => "nuiue",
3520 "Pacific/Norfolk" => "nfnlk",
3521 "Pacific/Noumea" => "ncnou",
3522 "Pacific/Pago_Pago" => "asppg",
3523 "Pacific/Palau" => "pwror",
3524 "Pacific/Pitcairn" => "pnpcn",
3525 "Pacific/Pohnpei" => "fmpni",
3526 "Pacific/Ponape" => "fmpni",
3527 "Pacific/Port_Moresby" => "pgpom",
3528 "Pacific/Rarotonga" => "ckrar",
3529 "Pacific/Saipan" => "mpspn",
3530 "Pacific/Samoa" => "asppg",
3531 "Pacific/Tahiti" => "pfppt",
3532 "Pacific/Tarawa" => "kitrw",
3533 "Pacific/Tongatapu" => "totbu",
3534 "Pacific/Truk" => "fmtkk",
3535 "Pacific/Wake" => "umawk",
3536 "Pacific/Wallis" => "wfmau",
3537 "Pacific/Yap" => "fmtkk",
3538 Poland => "plwaw",
3539 Portugal => "ptlis",
3540 PRC => "cnsha",
3541 PST8PDT => "pst8pdt",
3542 ROC => "twtpe",
3543 ROK => "krsel",
3544 Singapore => "sgsin",
3545 Turkey => "trist",
3546 UCT => "utc",
3547 Universal => "utc",
3548 "US/Alaska" => "usanc",
3549 "US/Aleutian" => "usadk",
3550 "US/Arizona" => "usphx",
3551 "US/Central" => "uschi",
3552 "US/East-Indiana" => "usind",
3553 "US/Eastern" => "usnyc",
3554 "US/Hawaii" => "ushnl",
3555 "US/Indiana-Starke" => "usknx",
3556 "US/Michigan" => "usdet",
3557 "US/Mountain" => "usden",
3558 "US/Pacific" => "uslax",
3559 "US/Pacific-New" => "uslax",
3560 "US/Samoa" => "asppg",
3561 UTC => "utc",
3562 "W-SU" => "rumow",
3563 Zulu => "utc",
3564 };
3565 };
3566  
3567 sub FREEZE
3568 0 ▶{
Subroutine FREEZE: not called CC=4 SCAR=30.0
Pod undocumented
3569 0 my $self = CORE::shift( @_ );
3570 0 ▶ my $serialiser = CORE::shift( @_ ) // '';
Condition0%0/2
shift @_ // ""
l!l
00
MC/DC0%0/1
shift @_ // ""
shift @_
Truth table0%0/2
A
A= shift @_
Aresult
11
00
3571 0 my $class = CORE::ref( $self );
3572 0 my %hash = %$self;
3573 # Return an array reference rather than a list so this works with Sereal and CBOR
3574 # On or before Sereal version 4.023, Sereal did not support multiple values returned
3575 0 ▶ CORE::return( [$class, \%hash] ) if( $serialiser eq 'Sereal' && Sereal::Encoder->VERSION <= version->parse( '4.023' ) );
Branch: 1 branch
BranchTrueFalseTotal
if $serialiser eq "Sereal" and "Sereal::Encoder"->VERSION <= "version"->parse("4.023") 0 0 0
Condition0%0/3
$serialiser eq "Sereal" and "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
!ll&&!rl&&r
000
MC/DC0%0/2
$serialiser eq "Sereal" and "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
$serialiser eq "Sereal" "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
Truth table0%0/3
A and B
A= $serialiser eq "Sereal"B= "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
ABresult
0X0
100
111
3576 # But Storable want a list with the first element being the serialised element
3577 0 CORE::return( $class, \%hash );
3578 }
3579  
3580 0 ▶sub STORABLE_freeze { return( shift->FREEZE( @_ ) ); }
Subroutine STORABLE_freeze: not called CC=1 SCAR=6.9
Pod undocumented
3581  
3582 0 ▶sub STORABLE_thaw { return( shift->THAW( @_ ) ); }
Subroutine STORABLE_thaw: not called CC=1 SCAR=6.9
Pod undocumented
3583  
3584 # NOTE: CBOR will call the THAW method with the stored classname as first argument, the constant string CBOR as second argument, and all values returned by FREEZE as remaining arguments.
3585 # NOTE: Storable calls it with a blessed object it created followed with $cloning and any other arguments initially provided by STORABLE_freeze
3586 sub THAW
3587 0 ▶{
Subroutine THAW: not called CC=10 SCAR=47.0
Pod undocumented
3588 0 my( $self, undef, @args ) = @_;
3589 0 ▶ my $ref = ( CORE::scalar( @args ) == 1 && CORE::ref( $args[0] ) eq 'ARRAY' ) ? CORE::shift( @args ) : \@args;
Branch: 1 branch
BranchTrueFalseTotal
scalar @args == 1 && ref $args[0] eq 'ARRAY' ? : 0 0 0
Condition0%0/3
scalar @args == 1 and ref $args[0] eq "ARRAY"
!ll&&!rl&&r
000
MC/DC0%0/2
scalar @args == 1 and ref $args[0] eq "ARRAY"
scalar @args == 1 ref $args[0] eq "ARRAY"
Truth table0%0/3
A and B
A= scalar @args == 1B= ref $args[0] eq "ARRAY"
ABresult
0X0
100
111
3590 0 ▶ my $class = ( CORE::defined( $ref ) && CORE::ref( $ref ) eq 'ARRAY' && CORE::scalar( @$ref ) > 1 ) ? CORE::shift( @$ref ) : ( CORE::ref( $self ) || $self );
Branch: 1 branch
BranchTrueFalseTotal
defined $ref && ref $ref eq 'ARRAY' && scalar @$ref > 1 ? : 0 0 0
Condition0%0/9
defined $ref and ref $ref eq "ARRAY" and scalar @$ref > 1
!ll&&!rl&&r
000
defined $ref and ref $ref eq "ARRAY"
!ll&&!rl&&r
000
ref $self or $self
l!l&&r!l&&!r
000
MC/DC0%0/3
defined $ref and ref $ref eq "ARRAY" and scalar @$ref > 1
defined $ref ref $ref eq "ARRAY" scalar @$ref > 1
MC/DC0%0/2
ref $self or $self
ref $self $self
Truth table0%0/4
A and B and C
A= defined $refB= ref $ref eq "ARRAY"C= scalar @$ref > 1
ABCresult
0XX0
10X0
1100
1111
Truth table0%0/3
A or B
A= ref $selfB= $self
ABresult
1X1
011
000
3591 0 ▶ my $hash = CORE::ref( $ref ) eq 'ARRAY' ? CORE::shift( @$ref ) : {};
Branch: 1 branch
BranchTrueFalseTotal
ref $ref eq 'ARRAY' ? : 0 0 0
3592 0 my $new;
3593 # Storable pattern requires to modify the object it created rather than returning a new one
3594 0 ▶ if( CORE::ref( $self ) )
Branch: 1 branch
BranchTrueFalseTotal
if (ref $self) { } 0 0 0
3595 {
3596 0 foreach( CORE::keys( %$hash ) )
3597 {
3598 0 $self->{ $_ } = CORE::delete( $hash->{ $_ } );
3599 }
3600 0 $new = $self;
3601 }
3602 else
3603 {
3604 0 $new = CORE::bless( $hash => $class );
3605 }
3606 0 CORE::return( $new );
3607 }
3608  
3609 0 ▶sub TO_JSON { return( shift->as_string ); }
Subroutine TO_JSON: not called CC=1 SCAR=6.9
Pod undocumented
3610  
3611 # NOTE: Locale::Unicode::Boolean class
3612 package Locale::Unicode::Boolean;
3613 BEGIN
3614 3 ▶{
Subroutine BEGIN: called CC=1 SCAR=0.2
3615 3 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3616 3 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3617 3 ▶ use vars qw( $VERSION $true $false );
Subroutine BEGIN: called CC=1 SCAR=0.0
3618 use overload
3619 0 ▶ "0+" => sub{ ${$_[0]} },
Subroutine BEGIN: called CC=1 SCAR=2.6
Subroutine __ANON__: not called CC=1 SCAR=6.9
3620 0 ▶ "++" => sub{ $_[0] = ${$_[0]} + 1 },
Subroutine __ANON__: not called CC=1 SCAR=6.9
3621 0 ▶ "--" => sub{ $_[0] = ${$_[0]} - 1 },
Subroutine __ANON__: not called CC=1 SCAR=6.9
3622 3 fallback => 1;
3623 3 $true = do{ bless( \( my $dummy = 1 ) => 'Locale::Unicode::Boolean' ) };
3624 3 $false = do{ bless( \( my $dummy = 0 ) => 'Locale::Unicode::Boolean' ) };
3625 3 our $VERSION = 'v0.1.0';
3626 };
3627 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3628 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3629  
3630 sub new
3631 0 ▶{
Subroutine new: not called CC=3 SCAR=24.8
3632 0 my $this = shift( @_ );
3633 0 ▶ my $self = bless( \( my $dummy = ( $_[0] ? 1 : 0 ) ) => ( ref( $this ) || $this ) );
Branch: 1 branch
BranchTrueFalseTotal
$_[0] ? : 0 0 0
Condition0%0/3
ref $this || $this
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $this || $this
ref $this $this
Truth table0%0/3
A || B
A= ref $thisB= $this
ABresult
1X1
011
000
3634 }
3635  
3636 sub clone
3637 0 ▶{
Subroutine clone: not called CC=2 SCAR=17.9
3638 0 my $self = shift( @_ );
3639 0 ▶ unless( ref( $self ) )
Branch: 1 branch
BranchTrueFalseTotal
unless (ref $self) 0 0 0
3640 {
3641 0 die( "clone() must be called with an object." );
3642 }
3643 0 my $copy = $$self;
3644 0 my $new = bless( \$copy => ref( $self ) );
3645 0 return( $new );
3646 }
3647  
3648 0 ▶sub false() { $false }
Subroutine false: not called CC=1 SCAR=6.9
3649  
3650 0 ▶sub is_bool($) { UNIVERSAL::isa( $_[0], 'Locale::Unicode::Boolean' ) }
Subroutine is_bool: not called CC=1 SCAR=6.9
3651  
3652 0 ▶sub is_true($) { $_[0] && UNIVERSAL::isa( $_[0], 'Locale::Unicode::Boolean' ) }
Subroutine is_true: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
$_[0] and UNIVERSAL::isa($_[0], "Locale::Unicode::Boolean") 0 0 0
3653  
3654 0 ▶sub is_false($) { !$_[0] && UNIVERSAL::isa( $_[0], 'Locale::Unicode::Boolean' ) }
Subroutine is_false: not called CC=2 SCAR=17.9
Branch: 1 branch
BranchTrueFalseTotal
not $_[0] and UNIVERSAL::isa($_[0], "Locale::Unicode::Boolean") 0 0 0
3655  
3656 0 ▶sub true() { $true }
Subroutine true: not called CC=1 SCAR=6.9
3657  
3658 sub FREEZE
3659 0 ▶{
Subroutine FREEZE: not called CC=4 SCAR=30.0
3660 0 my $self = CORE::shift( @_ );
3661 0 ▶ my $serialiser = CORE::shift( @_ ) // '';
Condition0%0/2
shift @_ // ""
l!l
00
MC/DC0%0/1
shift @_ // ""
shift @_
Truth table0%0/2
A
A= shift @_
Aresult
11
00
3662 0 my $class = CORE::ref( $self );
3663 # Return an array reference rather than a list so this works with Sereal and CBOR
3664 # On or before Sereal version 4.023, Sereal did not support multiple values returned
3665 0 ▶ CORE::return( [$class, $$self] ) if( $serialiser eq 'Sereal' && Sereal::Encoder->VERSION <= version->parse( '4.023' ) );
Branch: 1 branch
BranchTrueFalseTotal
if $serialiser eq "Sereal" and "Sereal::Encoder"->VERSION <= "version"->parse("4.023") 0 0 0
Condition0%0/3
$serialiser eq "Sereal" and "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
!ll&&!rl&&r
000
MC/DC0%0/2
$serialiser eq "Sereal" and "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
$serialiser eq "Sereal" "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
Truth table0%0/3
A and B
A= $serialiser eq "Sereal"B= "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
ABresult
0X0
100
111
3666 # But Storable want a list with the first element being the serialised element
3667 0 CORE::return( $$self );
3668 }
3669  
3670 0 ▶sub STORABLE_freeze { CORE::return( CORE::shift->FREEZE( @_ ) ); }
Subroutine STORABLE_freeze: not called CC=1 SCAR=6.9
3671  
3672 0 ▶sub STORABLE_thaw { CORE::return( CORE::shift->THAW( @_ ) ); }
Subroutine STORABLE_thaw: not called CC=1 SCAR=6.9
3673  
3674 # NOTE: CBOR will call the THAW method with the stored classname as first argument, the constant string CBOR as second argument, and all values returned by FREEZE as remaining arguments.
3675 # NOTE: Storable calls it with a blessed object it created followed with $cloning and any other arguments initially provided by STORABLE_freeze
3676 sub THAW
3677 0 ▶{
Subroutine THAW: not called CC=5 SCAR=34.0
3678 0 my( $self, undef, @args ) = @_;
3679 0 my( $class, $str );
3680 0 ▶ if( CORE::scalar( @args ) == 1 && CORE::ref( $args[0] ) eq 'ARRAY' )
Branch: 1 branch
BranchTrueFalseTotal
if (scalar @args == 1 and ref $args[0] eq 'ARRAY') { } 0 0 0
Condition0%0/3
scalar @args == 1 and ref $args[0] eq "ARRAY"
!ll&&!rl&&r
000
MC/DC0%0/2
scalar @args == 1 and ref $args[0] eq "ARRAY"
scalar @args == 1 ref $args[0] eq "ARRAY"
Truth table0%0/3
A and B
A= scalar @args == 1B= ref $args[0] eq "ARRAY"
ABresult
0X0
100
111
3681 {
3682 0 ( $class, $str ) = @{$args[0]};
3683 }
3684 else
3685 {
3686 0 ▶ $class = CORE::ref( $self ) || $self;
Condition0%0/3
ref $self || $self
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $self || $self
ref $self $self
Truth table0%0/3
A || B
A= ref $selfB= $self
ABresult
1X1
011
000
3687 0 $str = CORE::shift( @args );
3688 }
3689 # Storable pattern requires to modify the object it created rather than returning a new one
3690 0 ▶ if( CORE::ref( $self ) )
Branch: 1 branch
BranchTrueFalseTotal
if (ref $self) { } 0 0 0
3691 {
3692 0 $$self = $str;
3693 0 CORE::return( $self );
3694 }
3695 else
3696 {
3697 0 CORE::return( $class->new( $str ) );
3698 }
3699 }
3700  
3701 sub TO_JSON
3702 0 ▶{
Subroutine TO_JSON: not called CC=2 SCAR=17.9
3703 # JSON does not check that the value is a proper true or false. It stupidly assumes this is a string
3704 # The only way to make it understand is to return a scalar ref of 1 or 0
3705 # return( $_[0] ? 'true' : 'false' );
3706 0 ▶ return( $_[0] ? \1 : \0 );
Branch: 1 branch
BranchTrueFalseTotal
$_[0] ? : 0 0 0
3707 }
3708  
3709 # NOTE: Locale::Unicode::Exception class
3710 package Locale::Unicode::Exception;
3711 BEGIN
3712 3 ▶{
Subroutine BEGIN: called CC=1 SCAR=0.0
3713 3 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3714 3 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3715 3 ▶ use vars qw( $VERSION );
Subroutine BEGIN: called CC=1 SCAR=0.0
3716 3 ▶ use overload (
Subroutine BEGIN: called CC=1 SCAR=0.0
3717 '""' => 'as_string',
3718 1 ▶ bool => sub{ $_[0] },
Subroutine __ANON__: called CC=1 SCAR=0.0
3719 3 fallback => 1,
3720 3 );
3721 3 our $VERSION = 'v0.1.0';
3722 };
3723 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3724 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3725 3 ▶use overloading;
Subroutine BEGIN: called CC=1 SCAR=0.0
3726  
3727 sub new
3728 1 ▶{
Subroutine new: called CC=14 SCAR=38.5
3729 1 my $this = shift( @_ );
3730 1 ▶ my $self = bless( {} => ( ref( $this ) || $this ) );
Condition33%1/3
ref $this || $this
l!l&&r!l&&!r
010
MC/DC0%0/2
ref $this || $this
ref $this $this
Truth table33%1/3
A || B
A= ref $thisB= $this
ABresult
1X1
011
000
3731 1 my @info = caller;
3732 1 @$self{ qw( package file line ) } = @info[0..2];
3733 1 my $args = {};
3734 1 ▶ if( scalar( @_ ) == 1 &&
Branch: 2 branches
BranchTrueFalseTotal
if (scalar @_ == 1 and (ref $_[0] || '') eq 'HASH') { } 1 0 1
elsif (scalar @_ == 1 and defined $_[0] and ref $_[0] and $_[0]->isa('Locale::Unicode::Exception')) { } 0 0 0
Condition40%2/5
scalar @_ == 1 and (ref $_[0] || "") eq "HASH"
!ll&&!rl&&r
001
ref $_[0] || ''
l!l
10
MC/DC0%0/2
scalar @_ == 1 and (ref $_[0] || "") eq "HASH"
scalar @_ == 1 ref $_[0]
Truth table33%1/3
A and B
A= scalar @_ == 1B= ref $_[0]
ABresult
0X0
100
111
3735 ( ref( $_[0] ) || '' ) eq 'HASH' )
3736 {
3737 1 $args = shift( @_ );
3738 1 ▶ if( $args->{skip_frames} )
Branch: 1 branch
BranchTrueFalseTotal
if ($args->{"skip_frames"}) 1 0 1
3739 {
3740 1 @info = caller( int( $args->{skip_frames} ) );
3741 1 @$self{ qw( package file line ) } = @info[0..2];
3742 }
3743 1 ▶ $args->{message} ||= '';
Condition50%1/2
$args->{"message"} ||= ""
l!l
10
MC/DC0%0/1
$args->{"message"} ||= ""
$args->{"message"}
Truth table50%1/2
A
A= $args->{"message"}
Aresult
11
00
3744 1 foreach my $k ( qw( package file line message code type retry_after ) )
3745 {
3746 7 ▶ $self->{ $k } = $args->{ $k } if( CORE::exists( $args->{ $k } ) );
Branch: 1 branch
BranchTrueFalseTotal
if exists $args->{$k} 1 6 7
3747 }
3748 }
3749 ▶ elsif( scalar( @_ ) == 1 &&
Condition0%0/9
scalar @_ == 1 and defined $_[0] and ref $_[0] and $_[0]->isa("Locale::Unicode::Exception")
!ll&&!rl&&r
000
scalar @_ == 1 and defined $_[0] and ref $_[0]
!ll&&!rl&&r
000
scalar @_ == 1 and defined $_[0]
!ll&&!rl&&r
000
MC/DC0%0/4
scalar @_ == 1 and defined $_[0] and ref $_[0] and $_[0]->isa("Locale::Unicode::Exception")
scalar @_ == 1 defined $_[0] ref $_[0] $_[0]->isa("Locale::Unicode::Exception")
Truth table0%0/5
A and B and C and D
A= scalar @_ == 1B= defined $_[0]C= ref $_[0]D= $_[0]->isa("Locale::Unicode::Exception")
ABCDresult
0XXX0
10XX0
110X0
11100
11111
3750 defined( $_[0] ) &&
3751 ref( $_[0] ) &&
3752 $_[0]->isa( 'Locale::Unicode::Exception' ) )
3753 {
3754 0 my $o = shift( @_ );
3755 0 $self->{message} = $o->message;
3756 0 $self->{code} = $o->code;
3757 0 $self->{type} = $o->type;
3758 0 $self->{retry_after} = $o->retry_after;
3759 }
3760 else
3761 {
3762 0 ▶ $self->{message} = join( '', map( ref( $_ ) eq 'CODE' ? $_->() : $_, @_ ) );
Branch: 1 branch
BranchTrueFalseTotal
ref $_ eq 'CODE' ? : 0 0 0
3763 }
3764 1 return( $self );
3765 }
3766  
3767 # This is important as stringification is called by die, so as per the manual page, we need to end with new line
3768 # And will add the stack trace
3769 sub as_string
3770 0 ▶{
Subroutine as_string: not called CC=7 SCAR=37.0
3771 3 ▶ no overloading;
Subroutine BEGIN: called CC=1 SCAR=0.0
3772 0 my $self = shift( @_ );
3773 0 ▶ return( $self->{_cache_value} ) if( $self->{_cache_value} && !CORE::length( $self->{_reset} // '' ) );
Branch: 1 branch
BranchTrueFalseTotal
if $self->{"_cache_value"} and not length($self->{"_reset"} // "") 0 0 0
Condition0%0/5
$self->{"_cache_value"} and not length($self->{"_reset"} // "")
!ll&&!rl&&r
000
$self->{"_reset"} // ""
l!l
00
MC/DC0%0/2
$self->{"_cache_value"} and not length($self->{"_reset"} // "")
$self->{"_cache_value"} $self->{"_reset"}
Truth table0%0/3
A and not(B)
A= $self->{"_cache_value"}B= $self->{"_reset"}
ABresult
0X0
110
101
3774 0 my $str = $self->message;
3775 0 $str = "$str";
3776 0 $str =~ s/\r?\n$//g;
3777 0 ▶ $str .= sprintf( " within package %s at line %d in file %s", ( $self->{package} // 'undef' ), ( $self->{line} // 'undef' ), ( $self->{file} // 'undef' ) );
Condition0%0/6
$self->{"package"} // "undef"
l!l
00
$self->{"line"} // "undef"
l!l
00
$self->{"file"} // "undef"
l!l
00
MC/DC0%0/1
$self->{"package"} // "undef"
$self->{"package"}
MC/DC0%0/1
$self->{"line"} // "undef"
$self->{"line"}
MC/DC0%0/1
$self->{"file"} // "undef"
$self->{"file"}
Truth table0%0/2
A
A= $self->{"package"}
Aresult
11
00
Truth table0%0/2
A
A= $self->{"line"}
Aresult
11
00
Truth table0%0/2
A
A= $self->{"file"}
Aresult
11
00
3778 0 $self->{_cache_value} = $str;
3779 0 CORE::delete( $self->{_reset} );
3780 0 return( $str );
3781 }
3782  
3783 sub clone
3784 0 ▶{
Subroutine clone: not called CC=2 SCAR=17.9
3785 0 my $self = shift( @_ );
3786 # Safeguard
3787 0 ▶ die( "$self->clone() cannot be called as a class function" ) unless( ref( $self ) );
Branch: 1 branch
BranchTrueFalseTotal
unless ref $self 0 0 0
3788 0 my $new = bless( { %$self } => ref( $self ) );
3789 0 CORE::delete( $new->{_cache_value} );
3790 0 return( $new );
3791 }
3792  
3793 0 ▶sub code { return( shift->reset(@_)->_set_get_prop( 'code', @_ ) ); }
Subroutine code: not called CC=1 SCAR=6.9
3794  
3795 0 ▶sub file { return( shift->reset(@_)->_set_get_prop( 'file', @_ ) ); }
Subroutine file: not called CC=1 SCAR=6.9
3796  
3797 0 ▶sub line { return( shift->reset(@_)->_set_get_prop( 'line', @_ ) ); }
Subroutine line: not called CC=1 SCAR=6.9
3798  
3799 0 ▶sub message { return( shift->reset(@_)->_set_get_prop( 'message', @_ ) ); }
Subroutine message: not called CC=1 SCAR=6.9
3800  
3801 0 ▶sub package { return( shift->reset(@_)->_set_get_prop( 'package', @_ ) ); }
Subroutine package: not called CC=1 SCAR=6.9
3802  
3803 # From perlfunc docmentation on "die":
3804 # "If LIST was empty or made an empty string, and $@ contains an
3805 # object reference that has a "PROPAGATE" method, that method will
3806 # be called with additional file and line number parameters. The
3807 # return value replaces the value in $@; i.e., as if "$@ = eval {
3808 # $@->PROPAGATE(__FILE__, __LINE__) };" were called."
3809 sub PROPAGATE
3810 0 ▶{
Subroutine PROPAGATE: not called CC=3 SCAR=24.8
3811 0 my( $self, $file, $line ) = @_;
3812 0 ▶ if( defined( $file ) && defined( $line ) )
Branch: 1 branch
BranchTrueFalseTotal
if (defined $file and defined $line) 0 0 0
Condition0%0/3
defined $file and defined $line
!ll&&!rl&&r
000
MC/DC0%0/2
defined $file and defined $line
defined $file defined $line
Truth table0%0/3
A and B
A= defined $fileB= defined $line
ABresult
0X0
100
111
3813 {
3814 0 my $clone = $self->clone;
3815 0 $clone->file( $file );
3816 0 $clone->line( $line );
3817 0 return( $clone );
3818 }
3819 0 return( $self );
3820 }
3821  
3822 sub reset
3823 0 ▶{
Subroutine reset: not called CC=4 SCAR=30.0
3824 0 my $self = shift( @_ );
3825 0 ▶ if( !CORE::length( $self->{_reset} // '' ) && scalar( @_ ) )
Branch: 1 branch
BranchTrueFalseTotal
if (not length($self->{"_reset"} // "") and scalar @_) 0 0 0
Condition0%0/4
not length($self->{"_reset"} // "") and scalar @_
!ll
00
$self->{"_reset"} // ""
l!l
00
MC/DC0%0/1
not length($self->{"_reset"} // "") and scalar @_
$self->{"_reset"}
Truth table0%0/2
not(A)
A= $self->{"_reset"}
Aresult
10
01
3826 {
3827 0 $self->{_reset} = scalar( @_ );
3828 }
3829 0 return( $self );
3830 }
3831  
3832 sub rethrow
3833 0 ▶{
Subroutine rethrow: not called CC=2 SCAR=17.9
3834 0 my $self = shift( @_ );
3835 0 ▶ return if( !ref( $self ) );
Branch: 1 branch
BranchTrueFalseTotal
unless ref $self 0 0 0
3836 0 die( $self );
3837 }
3838  
3839 0 ▶sub retry_after { return( shift->_set_get_prop( 'retry_after', @_ ) ); }
Subroutine retry_after: not called CC=1 SCAR=6.9
3840  
3841 sub throw
3842 0 ▶{
Subroutine throw: not called CC=2 SCAR=17.9
3843 0 my $self = shift( @_ );
3844 0 my $e;
3845 0 ▶ if( @_ )
Branch: 1 branch
BranchTrueFalseTotal
if (@_) { } 0 0 0
3846 {
3847 0 my $msg = shift( @_ );
3848 0 $e = $self->new({
3849 skip_frames => 1,
3850 message => $msg,
3851 });
3852 }
3853 else
3854 {
3855 0 $e = $self;
3856 }
3857 0 die( $e );
3858 }
3859  
3860 0 ▶sub type { return( shift->reset(@_)->_set_get_prop( 'type', @_ ) ); }
Subroutine type: not called CC=1 SCAR=6.9
3861  
3862 sub _set_get_prop
3863 0 ▶{
Subroutine _set_get_prop: not called CC=3 SCAR=24.8
3864 0 my $self = shift( @_ );
3865 0 ▶ my $prop = shift( @_ ) || die( "No object property was provided." );
Condition0%0/2
shift @_ || die('No object property was provided.')
l!l
00
MC/DC0%0/1
shift @_ || die('No object property was provided.')
shift @_
Truth table0%0/2
A
A= shift @_
Aresult
11
00
3866 0 ▶ $self->{ $prop } = shift( @_ ) if( @_ );
Branch: 1 branch
BranchTrueFalseTotal
if @_ 0 0 0
3867 0 return( $self->{ $prop } );
3868 }
3869  
3870 sub FREEZE
3871 0 ▶{
Subroutine FREEZE: not called CC=4 SCAR=30.0
3872 0 my $self = CORE::shift( @_ );
3873 0 ▶ my $serialiser = CORE::shift( @_ ) // '';
Condition0%0/2
shift @_ // ""
l!l
00
MC/DC0%0/1
shift @_ // ""
shift @_
Truth table0%0/2
A
A= shift @_
Aresult
11
00
3874 0 my $class = CORE::ref( $self );
3875 0 my %hash = %$self;
3876 # Return an array reference rather than a list so this works with Sereal and CBOR
3877 # On or before Sereal version 4.023, Sereal did not support multiple values returned
3878 0 ▶ CORE::return( [$class, \%hash] ) if( $serialiser eq 'Sereal' && Sereal::Encoder->VERSION <= version->parse( '4.023' ) );
Branch: 1 branch
BranchTrueFalseTotal
if $serialiser eq "Sereal" and "Sereal::Encoder"->VERSION <= "version"->parse("4.023") 0 0 0
Condition0%0/3
$serialiser eq "Sereal" and "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
!ll&&!rl&&r
000
MC/DC0%0/2
$serialiser eq "Sereal" and "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
$serialiser eq "Sereal" "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
Truth table0%0/3
A and B
A= $serialiser eq "Sereal"B= "Sereal::Encoder"->VERSION <= "version"->parse("4.023")
ABresult
0X0
100
111
3879 # But Storable want a list with the first element being the serialised element
3880 0 CORE::return( $class, \%hash );
3881 }
3882  
3883 0 ▶sub STORABLE_freeze { return( shift->FREEZE( @_ ) ); }
Subroutine STORABLE_freeze: not called CC=1 SCAR=6.9
3884  
3885 0 ▶sub STORABLE_thaw { return( shift->THAW( @_ ) ); }
Subroutine STORABLE_thaw: not called CC=1 SCAR=6.9
3886  
3887 # NOTE: CBOR will call the THAW method with the stored classname as first argument, the constant string CBOR as second argument, and all values returned by FREEZE as remaining arguments.
3888 # NOTE: Storable calls it with a blessed object it created followed with $cloning and any other arguments initially provided by STORABLE_freeze
3889 sub THAW
3890 0 ▶{
Subroutine THAW: not called CC=10 SCAR=47.0
3891 0 my( $self, undef, @args ) = @_;
3892 0 ▶ my $ref = ( CORE::scalar( @args ) == 1 && CORE::ref( $args[0] ) eq 'ARRAY' ) ? CORE::shift( @args ) : \@args;
Branch: 1 branch
BranchTrueFalseTotal
scalar @args == 1 && ref $args[0] eq 'ARRAY' ? : 0 0 0
Condition0%0/3
scalar @args == 1 and ref $args[0] eq "ARRAY"
!ll&&!rl&&r
000
MC/DC0%0/2
scalar @args == 1 and ref $args[0] eq "ARRAY"
scalar @args == 1 ref $args[0] eq "ARRAY"
Truth table0%0/3
A and B
A= scalar @args == 1B= ref $args[0] eq "ARRAY"
ABresult
0X0
100
111
3893 0 ▶ my $class = ( CORE::defined( $ref ) && CORE::ref( $ref ) eq 'ARRAY' && CORE::scalar( @$ref ) > 1 ) ? CORE::shift( @$ref ) : ( CORE::ref( $self ) || $self );
Branch: 1 branch
BranchTrueFalseTotal
defined $ref && ref $ref eq 'ARRAY' && scalar @$ref > 1 ? : 0 0 0
Condition0%0/9
defined $ref and ref $ref eq "ARRAY" and scalar @$ref > 1
!ll&&!rl&&r
000
defined $ref and ref $ref eq "ARRAY"
!ll&&!rl&&r
000
ref $self or $self
l!l&&r!l&&!r
000
MC/DC0%0/3
defined $ref and ref $ref eq "ARRAY" and scalar @$ref > 1
defined $ref ref $ref eq "ARRAY" scalar @$ref > 1
MC/DC0%0/2
ref $self or $self
ref $self $self
Truth table0%0/4
A and B and C
A= defined $refB= ref $ref eq "ARRAY"C= scalar @$ref > 1
ABCresult
0XX0
10X0
1100
1111
Truth table0%0/3
A or B
A= ref $selfB= $self
ABresult
1X1
011
000
3894 0 ▶ my $hash = CORE::ref( $ref ) eq 'ARRAY' ? CORE::shift( @$ref ) : {};
Branch: 1 branch
BranchTrueFalseTotal
ref $ref eq 'ARRAY' ? : 0 0 0
3895 0 my $new;
3896 # Storable pattern requires to modify the object it created rather than returning a new one
3897 0 ▶ if( CORE::ref( $self ) )
Branch: 1 branch
BranchTrueFalseTotal
if (ref $self) { } 0 0 0
3898 {
3899 0 foreach( CORE::keys( %$hash ) )
3900 {
3901 0 $self->{ $_ } = CORE::delete( $hash->{ $_ } );
3902 }
3903 0 $new = $self;
3904 }
3905 else
3906 {
3907 0 $new = CORE::bless( $hash => $class );
3908 }
3909 0 CORE::return( $new );
3910 }
3911  
3912 0 ▶sub TO_JSON { return( shift->as_string ); }
Subroutine TO_JSON: not called CC=1 SCAR=6.9
3913  
3914 {
3915 # NOTE: Locale::Unicode::NullObject class
3916 package
3917 Locale::Unicode::NullObject;
3918 BEGIN
3919 {
3920 3 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3921 3 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3922 3 ▶ use overload (
Subroutine BEGIN: called CC=1 SCAR=0.2
3923 0 ▶ '""' => sub{ '' },
Subroutine __ANON__: not called CC=1 SCAR=6.9
3924 3 fallback => 1,
3925 3 );
3926 3 ▶ use Wanted;
Subroutine BEGIN: called CC=1 SCAR=0.0
Subroutine BEGIN: not called CC=1 SCAR=0.0
3927 };
3928 3 ▶ use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3929 3 ▶ use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
3930  
3931 sub new
3932 0 ▶ {
Subroutine new: not called CC=3 SCAR=24.8
3933 0 my $this = shift( @_ );
3934 0 ▶ my $ref = @_ ? { @_ } : {};
Branch: 1 branch
BranchTrueFalseTotal
@_ ? : 0 0 0
3935 0 ▶ return( bless( $ref => ( ref( $this ) || $this ) ) );
Condition0%0/3
ref $this || $this
l!l&&r!l&&!r
000
MC/DC0%0/2
ref $this || $this
ref $this $this
Truth table0%0/3
A || B
A= ref $thisB= $this
ABresult
1X1
011
000
3936 }
3937  
3938 sub AUTOLOAD
3939 0 ▶ {
Subroutine AUTOLOAD: not called CC=2 SCAR=17.9
3940 0 my( $method ) = our $AUTOLOAD =~ /([^:]+)$/;
3941 0 my $self = shift( @_ );
3942 0 ▶ if( want( 'OBJECT' ) )
Branch: 1 branch
BranchTrueFalseTotal
if (want("OBJECT")) 0 0 0
3943 {
3944 0 rreturn( $self );
3945 }
3946 # Otherwise, we return undef; Empty return returns undef in scalar context and empty list in list context
3947 0 return;
3948 };
3949 }
3950  
3951 3 1;
3952 # NOTE: POD
3953 __END__
↑ Summary