line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Acme::APHILIPP::Utils; |
2
|
|
|
|
|
|
|
|
3
|
2
|
|
|
2
|
|
54557
|
use 5.006; |
|
2
|
|
|
|
|
7
|
|
|
2
|
|
|
|
|
91
|
|
4
|
2
|
|
|
2
|
|
19
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
83
|
|
5
|
2
|
|
|
2
|
|
17
|
use warnings; |
|
2
|
|
|
|
|
10
|
|
|
2
|
|
|
|
|
83
|
|
6
|
|
|
|
|
|
|
|
7
|
2
|
|
|
2
|
|
10
|
use Exporter qw(import); |
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
329
|
|
8
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
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
|
|
|
|
|
|
|
sub sum { |
46
|
7
|
|
|
7
|
1
|
816
|
my $sum; |
47
|
7
|
|
|
|
|
15
|
foreach my $num ( grep { /\A-?\d+\.*\d*\z/ } @_ ) { |
|
18
|
|
|
|
|
112
|
|
48
|
14
|
|
|
|
|
24
|
$sum += $num; |
49
|
|
|
|
|
|
|
} |
50
|
7
|
|
|
|
|
29
|
$sum; |
51
|
|
|
|
|
|
|
} |
52
|
|
|
|
|
|
|
|
53
|
|
|
|
|
|
|
=head1 AUTHOR |
54
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
Andre Philipp, C<< >> |
56
|
|
|
|
|
|
|
|
57
|
|
|
|
|
|
|
=head1 BUGS |
58
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
Please report any bugs or feature requests to C, or through |
60
|
|
|
|
|
|
|
the web interface at L. 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 |
80
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
=item * AnnoCPAN: Annotated CPAN documentation |
82
|
|
|
|
|
|
|
|
83
|
|
|
|
|
|
|
L |
84
|
|
|
|
|
|
|
|
85
|
|
|
|
|
|
|
=item * CPAN Ratings |
86
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
L |
88
|
|
|
|
|
|
|
|
89
|
|
|
|
|
|
|
=item * Search CPAN |
90
|
|
|
|
|
|
|
|
91
|
|
|
|
|
|
|
L |
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 |
108
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
=cut |
111
|
|
|
|
|
|
|
|
112
|
|
|
|
|
|
|
1; # End of Acme::APHILIPP::Utils |