blib/lib/Acme/Ehoh.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 14 | 15 | 93.3 |
branch | 1 | 2 | 50.0 |
condition | 1 | 3 | 33.3 |
subroutine | 4 | 4 | 100.0 |
pod | 1 | 1 | 100.0 |
total | 21 | 25 | 84.0 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Acme::Ehoh; | ||||||
2 | 2 | 2 | 29136 | use 5; | |||
2 | 7 | ||||||
2 | 105 | ||||||
3 | 2 | 2 | 12 | use strict; | |||
2 | 5 | ||||||
2 | 75 | ||||||
4 | 2 | 2 | 21 | use warnings; | |||
2 | 4 | ||||||
2 | 460 | ||||||
5 | |||||||
6 | our $VERSION = "0.01"; | ||||||
7 | |||||||
8 | my @dir = (255, 165, 345, 165, 75); | ||||||
9 | |||||||
10 | sub direction { | ||||||
11 | 10 | 10 | 1 | 25 | my $arg = shift; | ||
12 | |||||||
13 | 10 | 53 | $arg =~ /^(-?\d+)$/; | ||||
14 | |||||||
15 | 10 | 71 | my $year = $1; | ||||
16 | |||||||
17 | 10 | 50 | 33 | 73 | if(!defined $year || $year <= 0){ | ||
18 | 0 | 0 | return undef; | ||||
19 | } | ||||||
20 | |||||||
21 | 10 | 95 | return $dir[$year % 5]; | ||||
22 | } | ||||||
23 | |||||||
24 | 1; | ||||||
25 | __END__ |