xref: /openbsd-src/gnu/usr.bin/perl/cpan/JSON-PP/lib/JSON/PP/Boolean.pm (revision f2a19305cfc49ea4d1a5feb55cd6c283c6f1e031)
15759b3d2Safresh1package JSON::PP::Boolean;
25759b3d2Safresh1
35759b3d2Safresh1use strict;
4*f2a19305Safresh1use warnings;
5*f2a19305Safresh1use overload ();
6*f2a19305Safresh1overload::unimport('overload', qw(0+ ++ -- fallback));
7f3efcd01Safresh1overload::import('overload',
85759b3d2Safresh1    "0+"     => sub { ${$_[0]} },
95759b3d2Safresh1    "++"     => sub { $_[0] = ${$_[0]} + 1 },
105759b3d2Safresh1    "--"     => sub { $_[0] = ${$_[0]} - 1 },
115759b3d2Safresh1    fallback => 1,
125759b3d2Safresh1);
135759b3d2Safresh1
14*f2a19305Safresh1our $VERSION = '4.16';
155759b3d2Safresh1
165759b3d2Safresh11;
175759b3d2Safresh1
185759b3d2Safresh1__END__
195759b3d2Safresh1
20898184e3Ssthen=head1 NAME
21898184e3Ssthen
22898184e3SsthenJSON::PP::Boolean - dummy module providing JSON::PP::Boolean
23898184e3Ssthen
24898184e3Ssthen=head1 SYNOPSIS
25898184e3Ssthen
26898184e3Ssthen # do not "use" yourself
27898184e3Ssthen
28898184e3Ssthen=head1 DESCRIPTION
29898184e3Ssthen
30898184e3SsthenThis module exists only to provide overload resolution for Storable and similar modules. See
31898184e3SsthenL<JSON::PP> for more info about this class.
32898184e3Ssthen
33898184e3Ssthen=head1 AUTHOR
34898184e3Ssthen
35898184e3SsthenThis idea is from L<JSON::XS::Boolean> written by Marc Lehmann <schmorp[at]schmorp.de>
36898184e3Ssthen
37f3efcd01Safresh1=head1 LICENSE
38f3efcd01Safresh1
39f3efcd01Safresh1This library is free software; you can redistribute it and/or modify
40f3efcd01Safresh1it under the same terms as Perl itself.
41f3efcd01Safresh1
42898184e3Ssthen=cut
43898184e3Ssthen
44