File Coverage

lib/POSIX/1003/Locale.pm
Criterion Covered Total %
statement 18 19 94.7
branch n/a
condition n/a
subroutine 6 7 85.7
pod n/a
total 24 26 92.3


line stmt bran cond sub pod time code
1             # Copyrights 2011-2020 by [Mark Overmeer].
2             # For other contributors see ChangeLog.
3             # See the manual pages for details on the licensing terms.
4             # Pod stripped from pm file by OODoc 2.02.
5             # This code is part of distribution POSIX-1003. Meta-POD processed with
6             # OODoc into POD and HTML manual-pages. See README.md
7             # Copyright Mark Overmeer. Licensed under the same terms as Perl itself.
8              
9             package POSIX::1003::Locale;
10 4     4   75619 use vars '$VERSION';
  4         15  
  4         242  
11             $VERSION = '1.02';
12              
13 4     4   25 use base 'POSIX::1003::Module';
  4         7  
  4         744  
14              
15 4     4   28 use warnings;
  4         8  
  4         113  
16 4     4   19 use strict;
  4         16  
  4         503  
17              
18             # Blocks from resp. limits.h and local.h
19             my @constants;
20             my @functions = qw/localeconv setlocale/;
21              
22             our %EXPORT_TAGS =
23             ( constants => \@constants
24             , functions => \@functions
25             , tables => [ '%locale' ]
26             );
27              
28             my $locale;
29             our %locale;
30              
31             BEGIN {
32 4     4   133 $locale = locale_table;
33 4         32 push @constants, keys %$locale;
34 4         95 tie %locale, 'POSIX::1003::ReadOnlyTable', $locale;
35             }
36              
37              
38             sub _create_constant($)
39 17     17   30 { my ($class, $name) = @_;
40 17         29 my $val = $locale->{$name};
41 17     0   109 sub () {$val};
  0            
42             }
43              
44              
45             1;