blib/lib/Test/Spec/SharedHash.pm | |||
---|---|---|---|
Criterion | Covered | Total | % |
statement | 16 | 17 | 94.1 |
branch | n/a | ||
condition | n/a | ||
subroutine | 5 | 6 | 83.3 |
pod | 0 | 1 | 0.0 |
total | 21 | 24 | 87.5 |
line | stmt | bran | cond | sub | pod | time | code |
---|---|---|---|---|---|---|---|
1 | package Test::Spec::SharedHash; | ||||||
2 | 15 | 15 | 120 | use strict; | |||
15 | 41 | ||||||
15 | 567 | ||||||
3 | 15 | 15 | 119 | use warnings; | |||
15 | 41 | ||||||
15 | 555 | ||||||
4 | 15 | 15 | 109 | use Tie::Hash; | |||
15 | 38 | ||||||
15 | 532 | ||||||
5 | 15 | 15 | 119 | use base qw(Tie::StdHash); | |||
15 | 39 | ||||||
15 | 6506 | ||||||
6 | |||||||
7 | # a semaphore | ||||||
8 | our $Initialized = 0; | ||||||
9 | |||||||
10 | our %STASH; | ||||||
11 | |||||||
12 | sub TIEHASH { | ||||||
13 | 2 | 2 | 5 | my $class = shift; | |||
14 | 2 | 5 | my $ref = \%STASH; | ||||
15 | 2 | 5 | bless $ref, $class; | ||||
16 | 2 | 7 | return $ref; | ||||
17 | } | ||||||
18 | |||||||
19 | sub reset { | ||||||
20 | 0 | 0 | 0 | %STASH = (); | |||
21 | } | ||||||
22 | |||||||
23 | 1; |