File Coverage

blib/lib/Tie/Hash/Create.pm
Criterion Covered Total %
statement 16 17 94.1
branch n/a
condition n/a
subroutine 5 6 83.3
pod 2 2 100.0
total 23 25 92.0


line stmt bran cond sub pod time code
1             package slot;
2            
3             ## These constant may be changed but in accordance with the positions
4             ## of the object created in the constuructors of class Tie::Hash::Create
5             ## defined here and must hold for any class derived from Tie::Hash::Create
6             ## too as e.g. Tie::Hash::KeysMask and Tie::Hash::Modulate.
7            
8             sub HREF() {1}
9             # sub STATUS() {2} # reserved
10             # sub DEFAULT(){3} # -> Modulate (subclass)
11             # sub KM() {4} # -> KeysMask
12            
13             package Tie::Hash::Create;
14            
15 1     1   23889 use 5.008007;
  1         4  
  1         57  
16             our $VERSION = 0.01;
17 1     1   6 use strict;
  1         2  
  1         38  
18 1     1   16 no strict 'subs';
  1         10  
  1         39  
19 1     1   5 use Carp;
  1         2  
  1         226  
20            
21             require Tie::Hash;
22             our @ISA = qw ( Tie::ExtraHash );
23            
24             sub newHASH
25             {
26 1     1 1 11 my $class = shift;
27 1         3 my %Baby = ();
28 1         11 my $to = tie %Baby,$class,@_;
29 1         14 $to->[slot::HREF] = \%Baby;
30             }
31            
32 0     0 1   sub c {$_[0]->[slot::HREF]} # content
33            
34             1;
35             __END__