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 | 88 | use strict; | |||
14 | 32 | ||||||
14 | 399 | ||||||
3 | 14 | 14 | 77 | use warnings; | |||
14 | 26 | ||||||
14 | 339 | ||||||
4 | 14 | 14 | 72 | use Tie::Hash; | |||
14 | 27 | ||||||
14 | 377 | ||||||
5 | 14 | 14 | 68 | use base qw(Tie::StdHash); | |||
14 | 26 | ||||||
14 | 3895 | ||||||
6 | |||||||
7 | # a semaphore | ||||||
8 | our $Initialized = 0; | ||||||
9 | |||||||
10 | our %STASH; | ||||||
11 | |||||||
12 | sub TIEHASH { | ||||||
13 | 2 | 2 | 4 | my $class = shift; | |||
14 | 2 | 4 | my $ref = \%STASH; | ||||
15 | 2 | 3 | bless $ref, $class; | ||||
16 | 2 | 5 | return $ref; | ||||
17 | } | ||||||
18 | |||||||
19 | sub reset { | ||||||
20 | 0 | 0 | 0 | %STASH = (); | |||
21 | } | ||||||
22 | |||||||
23 | 1; |