Commit | Line | Data |
f0276afb |
1 | package DBM::Deep::Null; |
2 | |
3 | use 5.006_000; |
4 | |
5 | use strict; |
6 | use warnings FATAL => 'all'; |
7 | |
8 | =head1 NAME |
9 | |
10 | DBM::Deep::Null |
11 | |
12 | =head1 PURPOSE |
13 | |
1c62d370 |
14 | This is an internal-use-only object for L<DBM::Deep>. It acts as a NULL object |
15 | in the same vein as MARCEL's L<Class::Null>. I couldn't use L<Class::Null> |
f0276afb |
16 | because DBM::Deep needed an object that always evaluated as undef, not an |
17 | implementation of the Null Class pattern. |
18 | |
19 | =head1 OVERVIEW |
20 | |
21 | It is used to represent null sectors in DBM::Deep. |
22 | |
23 | =cut |
24 | |
25 | use overload |
26 | 'bool' => sub { undef }, |
27 | '""' => sub { undef }, |
66285e35 |
28 | '0+' => sub { 0 }, |
f0276afb |
29 | fallback => 1, |
30 | nomethod => 'AUTOLOAD'; |
31 | |
32 | sub AUTOLOAD { return; } |
33 | |
34 | 1; |
35 | __END__ |