File Coverage

blib/lib/ACME/THEDANIEL/Utils.pm
Criterion Covered Total %
statement 20 20 100.0
branch 2 2 100.0
condition n/a
subroutine 6 6 100.0
pod 1 1 100.0
total 29 29 100.0


line stmt bran cond sub pod time code
1             package ACME::THEDANIEL::Utils;
2              
3 2     2   38275 use 5.006;
  2         4  
4 2     2   6 use strict;
  2         2  
  2         32  
5 2     2   6 use warnings;
  2         8  
  2         52  
6              
7 2     2   8 use Scalar::Util qw( looks_like_number );
  2         2  
  2         172  
8 2     2   7 use Carp qw ( croak );
  2         3  
  2         228  
9              
10             =head1 NAME
11              
12             ACME::THEDANIEL::Utils - The great new ACME::THEDANIEL::Utils!
13              
14             =head1 VERSION
15              
16             Version 0.01
17              
18             =cut
19              
20             our $VERSION = '0.01';
21              
22              
23             =head1 SYNOPSIS
24              
25             Used to complete the Intermediate Perl textbook
26              
27             =head1 SUBROUTINES/METHODS
28              
29             =head2 sum
30              
31             =cut
32              
33             sub sum {
34 5     5 1 53 my $sum;
35 5         9 foreach my $num ( @_ ) {
36 9 100       28 if ( !looks_like_number( $num ) ) {
37 2         30 croak "Invalid input: $num"
38             }
39              
40 7         5 $sum += $num;
41             }
42 3         11 return $sum;
43             }
44              
45             =head1 AUTHOR
46              
47             Daniel jones, C<< >>
48              
49             =head1 BUGS
50              
51             Please report any bugs or feature requests to C, or through
52             the web interface at L. I will be notified, and then you'll
53             automatically be notified of progress on your bug as I make changes.
54              
55              
56             =head1 SUPPORT
57              
58             You can find documentation for this module with the perldoc command.
59              
60             perldoc ACME::THEDANIEL::Utils
61              
62              
63             You can also look for information at:
64              
65             =over 4
66              
67             =item * RT: CPAN's request tracker (report bugs here)
68              
69             L
70              
71             =item * AnnoCPAN: Annotated CPAN documentation
72              
73             L
74              
75             =item * CPAN Ratings
76              
77             L
78              
79             =item * Search CPAN
80              
81             L
82              
83             =back
84              
85              
86             =head1 ACKNOWLEDGEMENTS
87             Intermediate Perl, 2nd Edition.
88              
89             =head1 LICENSE AND COPYRIGHT
90              
91             Copyright 2017 Daniel jones.
92              
93             This program is free software; you can redistribute it and/or modify it
94             under the terms of the the Artistic License (2.0). You may obtain a
95             copy of the full license at:
96              
97             L
98              
99             Any use, modification, and distribution of the Standard or Modified
100             Versions is governed by this Artistic License. By using, modifying or
101             distributing the Package, you accept this license. Do not use, modify,
102             or distribute the Package, if you do not accept this license.
103              
104             If your Modified Version has been derived from a Modified Version made
105             by someone other than you, you are nevertheless required to ensure that
106             your Modified Version complies with the requirements of this license.
107              
108             This license does not grant you the right to use any trademark, service
109             mark, tradename, or logo of the Copyright Holder.
110              
111             This license includes the non-exclusive, worldwide, free-of-charge
112             patent license to make, have made, use, offer to sell, sell, import and
113             otherwise transfer the Package with respect to any patent claims
114             licensable by the Copyright Holder that are necessarily infringed by the
115             Package. If you institute patent litigation (including a cross-claim or
116             counterclaim) against any party alleging that the Package constitutes
117             direct or contributory patent infringement, then this Artistic License
118             to you shall terminate on the date that such litigation is filed.
119              
120             Disclaimer of Warranty: THE PACKAGE IS PROVIDED BY THE COPYRIGHT HOLDER
121             AND CONTRIBUTORS "AS IS' AND WITHOUT ANY EXPRESS OR IMPLIED WARRANTIES.
122             THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
123             PURPOSE, OR NON-INFRINGEMENT ARE DISCLAIMED TO THE EXTENT PERMITTED BY
124             YOUR LOCAL LAW. UNLESS REQUIRED BY LAW, NO COPYRIGHT HOLDER OR
125             CONTRIBUTOR WILL BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, OR
126             CONSEQUENTIAL DAMAGES ARISING IN ANY WAY OUT OF THE USE OF THE PACKAGE,
127             EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
128              
129              
130             =cut
131              
132             1; # End of ACME::THEDANIEL::Utils