File Coverage

blib/lib/String/Normal/Config/AddressStem.pm
Criterion Covered Total %
statement 15 16 93.7
branch 1 4 25.0
condition n/a
subroutine 4 4 100.0
pod n/a
total 20 24 83.3


line stmt bran cond sub pod time code
1             package String::Normal::Config::AddressStem;
2 9     9   45 use strict;
  9         10  
  9         180  
3 9     9   25 use warnings;
  9         11  
  9         168  
4              
5 9     9   29 use String::Normal::Config;
  9         10  
  9         964  
6              
7             sub _data {
8 2     2   6 my %params = @_;
9              
10 2         2 my $fh;
11 2 50       5 if ($params{address_stem}) {
12 0 0       0 open $fh, $params{address_stem} or die "Can't read '$params{address_stem}' $!\n";
13             } else {
14 2         6 $fh = *DATA;
15             }
16              
17 2         9 my %stem = String::Normal::Config::_slurp( $fh );
18 2         67 return \%stem;
19             }
20              
21             1;
22              
23             =head1 NAME
24              
25             String::Normal::Config::AddressStem;
26              
27             =head1 DESCRIPTION
28              
29             This package defines removals to be performed on the address type.
30              
31             =head1 STRUCTURE
32              
33             One entry pair per line: first the value to be matched then the value
34             to be changed to. For example:
35              
36             foo fu
37              
38             Would change all occurances of C to C. See C<__DATA__> block below.
39              
40             You can provide your own data by creating a text file containing your
41             values and provide the path to that file via the constructor:
42              
43             my $normalizer = String::Normal->new( address_stem => '/path/to/values.txt' );
44              
45             =head1 AUTHOR
46              
47             Jeff Anderson, C<< >>
48              
49             =head1 LICENSE AND COPYRIGHT
50              
51             Copyright 2016 Jeff Anderson.
52              
53             This program is free software; you can redistribute it and/or modify it
54             under the terms of the the Artistic License (2.0). You may obtain a
55             copy of the full license at:
56              
57             L
58              
59             Any use, modification, and distribution of the Standard or Modified
60             Versions is governed by this Artistic License. By using, modifying or
61             distributing the Package, you accept this license. Do not use, modify,
62             or distribute the Package, if you do not accept this license.
63              
64             If your Modified Version has been derived from a Modified Version made
65             by someone other than you, you are nevertheless required to ensure that
66             your Modified Version complies with the requirements of this license.
67              
68             This license does not grant you the right to use any trademark, service
69             mark, tradename, or logo of the Copyright Holder.
70              
71             This license includes the non-exclusive, worldwide, free-of-charge
72             patent license to make, have made, use, offer to sell, sell, import and
73             otherwise transfer the Package with respect to any patent claims
74             licensable by the Copyright Holder that are necessarily infringed by the
75             Package. If you institute patent litigation (including a cross-claim or
76             counterclaim) against any party alleging that the Package constitutes
77             direct or contributory patent infringement, then this Artistic License
78             to you shall terminate on the date that such litigation is filed.
79              
80             Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
81             AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
82             THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
83             PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
84             YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
85             CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
86             CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
87             EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
88              
89             =cut
90              
91             __DATA__