blib/lib/Geography/States/NoUnicodeWarnings.pm

filter: Statementstmt 100% 22 / 22 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 6 / 6 Podpod n/a totaltotal 100% 28 / 28 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
↑ Summary
1 package Geography::States::NoUnicodeWarnings;
2  
3 2 ▶use 5.010;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 2 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6 2 ▶no warnings 'uninitialized';
Subroutine BEGIN: called CC=1 SCAR=0.0
7  
8 2 ▶use Module::Load;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 2 our $VERSION = '0.004';
11 2 $VERSION = eval $VERSION;
12  
13 =head1 NAME
14  
15 Geography::States::NoUnicodeWarnings - use Geography::States without warnings
16  
17 =head1 SYNOPSIS
18  
19 use open ':encoding(utf8)';
20 use Geography::States::NoUnicodeWarnings;
21 # STDERR is not full of warnings about characters not mapping to Unicode
22  
23 =head1 DESCRIPTION
24  
25 Geography::States is a decent Perl module, tried and tested. It hasn't updated
26 for a while, but then e.g. the USA, Canada etc. haven't added states recently,
27 so there hasn't been a need.
28  
29 Under certain circumstances - specifically if you have set a global character
30 encoding for PerlIO - using Geography::States may cause warnings at compile-
31 time. Or it may not; you may be lucky. I haven't managed to narrow down
32 exactly what causes the lack of warnings - it's not simply a matter of locale,
33 for instance - but flavours of Perl between 5.10 and 5.14 appear to be
34 affected.
35  
36 This module fixes that. Just say C<use Geography::States::NoUnicodeWarnings>
37 where you would otherwise have said C<use Geography::States> and the warnings
38 will go away.
39  
40 The Brazilian States that give the warnings will probably not be corrupted,
41 although they may not be proper Unicode.
42  
43 =cut
44  
45 {
46 2 ▶ use open ':std';
Subroutine BEGIN: called CC=1 SCAR=0.0
47 2 Module::Load::load('Geography::States');
48 }
49  
50 =head1 AUTHOR
51  
52 Sam Kington <skington@cpan.org>
53  
54 The source code for this module is hosted on GitHub
55 L<https://github.com/skington/geography-states-nounicodewarnings> - this is
56 probably the best place to look for suggestions and feedback.
57  
58 =head1 COPYRIGHT
59  
60 Copyright (c) 2015 Sam Kington
61  
62 =cut
63  
64 2 1;
↑ Summary