4b41cdf381e9f37ded6da575a070710027496458
[dbsrgits/DBM-Deep.git] / lib / DBM / Deep / Null.pm
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
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>
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 },
28     '0+'     => sub { undef },
29     fallback => 1,
30     nomethod => 'AUTOLOAD';
31
32 sub AUTOLOAD { return; }
33
34 1;
35 __END__