GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages


Manual Reference Pages  -  BSON::BOOL (3)

.ds Aq ’

NAME

BSON::Bool - Boolean data for BSON

CONTENTS

SYNOPSIS



    use BSON;

    my $true  = BSON::Bool->true;
    my $false = BSON::Bool->false;
    my $odd   = BSON::Bool->new( time % 2 )

    print "Odd times!" if $odd;



DESCRIPTION

This module is needed for BSON and it manages BSON’s boolean element.

METHODS

    new

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;



    true

As a secondary constructor it returns a true instance.

    false

As a secondary constructor it returns a false instance.

    value

Returns 0 or 1 for false and true.

OVERLOAD

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!";
    }



SEE ALSO

BSON

AUTHOR

minimalist, <minimalist at lavabit.com>

BUGS

Bug reports and patches are welcome. Reports which include a failing Test::More style test are helpful and will receive priority.

LICENSE AND COPYRIGHT

Copyright 2011 minimalist.

This program is free software; you can redistribute it and/or modify it under the terms as perl itself.

Search for    or go to Top of page |  Section 3 |  Main Index


perl v5.20.3 BSON::BOOL (3) 2011-07-22

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with manServer 1.07.