| … | |
… | |
| 12 | =cut |
12 | =cut |
| 13 | |
13 | |
| 14 | use strict; |
14 | use strict; |
| 15 | use warnings; |
15 | use warnings; |
| 16 | use GDBM_File; |
16 | use GDBM_File; |
|
|
17 | use Carp; |
| 17 | |
18 | |
| 18 | use constant STYLE => "hash"; |
19 | use constant STYLE => "hash"; |
| 19 | |
20 | |
| 20 | # GDBM settings |
21 | # GDBM settings |
| 21 | use constant MAX_TIE_ATTEMPTS => 30; |
22 | use constant MAX_TIE_ATTEMPTS => 30; |
| … | |
… | |
| 79 | # hash-style methods |
80 | # hash-style methods |
| 80 | ################################################################################ |
81 | ################################################################################ |
| 81 | |
82 | |
| 82 | sub hash($) { |
83 | sub hash($) { |
| 83 | my ($self) = @_; |
84 | my ($self) = @_; |
| 84 | die "hash not tied" |
85 | croak "hash not tied" |
| 85 | unless tied %{$self->{hash}}; |
86 | unless tied %{$self->{hash}}; |
| 86 | return $self->{hash}; |
87 | return $self->{hash}; |
| 87 | } |
88 | } |
| 88 | |
89 | |
| 89 | 1; |
90 | 1; |