blib/lib/PID/File/Guard.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 14 | 14 | 100.0 |
branch | 2 | 2 | 100.0 |
condition | n/a | ||
subroutine | 5 | 5 | 100.0 |
pod | 0 | 1 | 0.0 |
total | 21 | 22 | 95.4 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package PID::File::Guard; | ||||||
2 | |||||||
3 | 18 | 18 | 616 | use 5.006; | |||
18 | 54 | ||||||
18 | 672 | ||||||
4 | |||||||
5 | 18 | 18 | 88 | use strict; | |||
18 | 32 | ||||||
18 | 515 | ||||||
6 | 18 | 18 | 101 | use warnings; | |||
18 | 39 | ||||||
18 | 2376 | ||||||
7 | |||||||
8 | sub new | ||||||
9 | { | ||||||
10 | 9 | 9 | 0 | 1587 | my ( $class, $sub ) = @_; | ||
11 | 9 | 100 | 51 | die "Can't create guard in void context" if ! defined wantarray; | |||
12 | 8 | 87 | return bless $sub, $class; | ||||
13 | } | ||||||
14 | |||||||
15 | sub DESTROY | ||||||
16 | { | ||||||
17 | 8 | 8 | 2079 | my $self = shift; | |||
18 | 8 | 54 | $self->(); | ||||
19 | } | ||||||
20 | |||||||
21 | 1; |