BSON::Bool - Boolean data for BSON
version 0.12
use BSON; my $true = BSON::Bool->true; my $false = BSON::Bool->false; my $odd = BSON::Bool->new( time % 2 ) print "Odd times!" if $odd;
This module is needed for BSON and it manages BSON's boolean element.
Main constructor which takes a single parameter. Zero or undef create a false instance, and everything else creates a true instance.
undef
false
true
my $true = BSON::Bool->new(255); my $false = BSON::Bool->new;
As a secondary constructor it returns a true instance.
As a secondary constructor it returns a false instance.
Returns 0 or 1 for false and true.
0
1
All boolean operations are overloaded, so the class instance can be used as a boolean variable itself.
if ( BSON::Bool->true ) { print "You kick ass!"; }
BSON
minimalist <minimalist@lavabit.com>
David Golden <david@mongodb.com>
This software is Copyright (c) 2015 by minimalist and MongoDB, Inc..
This is free software, licensed under:
The Apache License, Version 2.0, January 2004
To install BSON, copy and paste the appropriate command in to your terminal.
cpanm
cpanm BSON
CPAN shell
perl -MCPAN -e shell install BSON
For more information on module installation, please visit the detailed CPAN module installation guide.