Heray-Was-Here
Server : Apache
System : Linux vps103298.mylogin.co 4.18.0-513.11.1.el8_9.x86_64 #1 SMP Wed Jan 17 02:00:40 EST 2024 x86_64
User : calvet ( 273824)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /proc/thread-self/root/usr/share/perl5/vendor_perl/DBM/Deep/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : //proc/thread-self/root/usr/share/perl5/vendor_perl/DBM/Deep/Null.pm
package DBM::Deep::Null;

use 5.008_004;

use strict;
use warnings FATAL => 'all';

=head1 NAME

DBM::Deep::Null - NULL object

=head1 PURPOSE

This is an internal-use-only object for L<DBM::Deep>. It acts as a NULL object
in the same vein as MARCEL's L<Class::Null>. I couldn't use L<Class::Null>
because DBM::Deep needed an object that always evaluated as undef, not an
implementation of the Null Class pattern.

=head1 OVERVIEW

It is used to represent null sectors in DBM::Deep.

=cut

use overload
    'bool'   => sub { undef },
    '""'     => sub { undef },
    '0+'     => sub { 0 },
   ('cmp'    => 
    '<=>'    => sub {
                  return 0 if !defined $_[1] || !length $_[1];
                  return $_[2] ? 1 : -1;
                }
   )[0,2,1,2], # same sub for both ops
    '%{}'    => sub {
                  require Carp;
                  Carp::croak("Can't use a stale reference as a HASH");
                },
    '@{}'    => sub {
                  require Carp;
                  Carp::croak("Can't use a stale reference as an ARRAY");
                },
    fallback => 1,
    nomethod => 'AUTOLOAD';

sub AUTOLOAD { return; }

1;
__END__

Hry