| BSON::Bool - Boolean data for BSON |
BSON::Bool - Boolean data for BSON
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.
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.
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 at lavabit.com>
Bug reports and patches are welcome. Reports which include a failing Test::More style test are helpful and will receive priority.
Copyright 2011 minimalist.
This program is free software; you can redistribute it and/or modify it under the terms as perl itself.
| BSON::Bool - Boolean data for BSON |