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 | 14 | 14 | 96 | use strict; | |||
14 | 31 | ||||||
14 | 413 | ||||||
3 | 14 | 14 | 81 | use warnings; | |||
14 | 29 | ||||||
14 | 385 | ||||||
4 | 14 | 14 | 80 | use Tie::Hash; | |||
14 | 28 | ||||||
14 | 411 | ||||||
5 | 14 | 14 | 80 | use base qw(Tie::StdHash); | |||
14 | 25 | ||||||
14 | 4441 | ||||||
6 | |||||||
7 | # a semaphore | ||||||
8 | our $Initialized = 0; | ||||||
9 | |||||||
10 | our %STASH; | ||||||
11 | |||||||
12 | sub TIEHASH { | ||||||
13 | 2 | 2 | 7 | my $class = shift; | |||
14 | 2 | 6 | my $ref = \%STASH; | ||||
15 | 2 | 6 | bless $ref, $class; | ||||
16 | 2 | 7 | return $ref; | ||||
17 | } | ||||||
18 | |||||||
19 | sub reset { | ||||||
20 | 0 | 0 | 0 | %STASH = (); | |||
21 | } | ||||||
22 | |||||||
23 | 1; |