blib/lib/Acme/APHILIPP/Utils.pm

filter: Statementstmt 100% 19 / 19 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 5 / 5 Podpod 100% 1 / 1 totaltotal 100% 25 / 25 CC 2 SCAR 2.9
CC
2
Cov
100%
sum
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
↑ Summary
1 package Acme::APHILIPP::Utils;
2  
3 3 ▶use 5.006;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 3 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
5 3 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
6  
7 3 ▶use Exporter qw(import);
Subroutine BEGIN: called CC=1 SCAR=0.0
8 3 our @EXPORT = qw(sum);
9  
10 =head1 NAME
11  
12 Acme::APHILIPP::Utils - Test module that sums
13  
14 =head1 VERSION
15  
16 Version 0.05
17  
18 =cut
19  
20 3 our $VERSION = '0.05';
21  
22  
23 =head1 SYNOPSIS
24  
25 use Acme::APHILIPP::Utils;
26  
27 my $sum = sum(1, 2, 3);
28 print "$sum\n"; # 6
29  
30 =head1 EXPORT
31  
32 A list of functions that can be exported.
33  
34 sum()
35  
36 =head1 SUBROUTINES/METHODS
37  
38 =head2 sum
39  
40 Returns the sum of the numbers passed to it, ignoring arguments
41 that don't look like numbers.
42  
43 =cut
44  
45 7 ▶sub sum {
Subroutine sum: called CC=2 SCAR=6.9
Pod documented
46 7 my $sum;
47 7 foreach my $num ( grep { /\A-?\d+\.*\d*\z/ } @_ ) {
48 14 $sum += $num;
49 }
50 7 $sum;
51 }
52  
53 =head1 AUTHOR
54  
55 Andre Philipp, C<< <aphilipp at cpan.org> >>
56  
57 =head1 BUGS
58  
59 Please report any bugs or feature requests to C<bug-acme-aphilipp-utils at rt.cpan.org>, or through
60 the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Acme-APHILIPP-Utils>. I will be notified, and then you'll
61 automatically be notified of progress on your bug as I make changes.
62  
63  
64  
65  
66 =head1 SUPPORT
67  
68 You can find documentation for this module with the perldoc command.
69  
70 perldoc Acme::APHILIPP::Utils
71  
72  
73 You can also look for information at:
74  
75 =over 4
76  
77 =item * RT: CPAN's request tracker (report bugs here)
78  
79 L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=Acme-APHILIPP-Utils>
80  
81 =item * AnnoCPAN: Annotated CPAN documentation
82  
83 L<http://annocpan.org/dist/Acme-APHILIPP-Utils>
84  
85 =item * CPAN Ratings
86  
87 L<http://cpanratings.perl.org/d/Acme-APHILIPP-Utils>
88  
89 =item * Search CPAN
90  
91 L<http://search.cpan.org/dist/Acme-APHILIPP-Utils/>
92  
93 =back
94  
95  
96 =head1 ACKNOWLEDGEMENTS
97  
98  
99 =head1 LICENSE AND COPYRIGHT
100  
101 Copyright 2013 Andre Philipp.
102  
103 This program is free software; you can redistribute it and/or modify it
104 under the terms of the the Artistic License (2.0). You may obtain a
105 copy of the full license at:
106  
107 L<http://www.perlfoundation.org/artistic_license_2_0>
108  
109  
110 =cut
111  
112 3 1; # End of Acme::APHILIPP::Utils
↑ Summary