| 1 | 2 | ▶ | use strict; use warnings; |
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||
| 2 | |||
| 3 | package Memoize::NDBM_File; | ||
| 4 | our $VERSION = '1.17'; | ||
| 5 | |||
| 6 | 0 | ▶ | use NDBM_File; |
|
Subroutine
BEGIN: called CC=1 SCAR=2.6
| |||
| 7 | our @ISA = qw(NDBM_File); | ||
| 8 | |||
| 9 | # NDBM_File cannot store undef and will store an empty string if you try | ||
| 10 | # but it does return undef if you try to read a non-existent key | ||
| 11 | # so we can emulate exists() using defined() | ||
| 12 | sub EXISTS { | ||
| 13 | defined shift->FETCH(@_); | ||
| 14 | } | ||
| 15 | |||
| 16 | # Perl 5.37.3 adds this EXISTS emulation to NDBM_File itself | ||
| 17 | delete $Memoize::NDBM_File::{'EXISTS'} | ||
| 18 | if eval { NDBM_File->VERSION( '1.16' ) }; | ||
| 19 | |||
| 20 | 1; | ||
| 21 | |||
| 22 | __END__ | ||