Help-Site Computer Manuals
Software
Hardware
Programming
Networking
  Algorithms & Data Structures   Programming Languages   Revision Control
  Protocols
  Cameras   Computers   Displays   Keyboards & Mice   Motherboards   Networking   Printers & Scanners   Storage
  Windows   Linux & Unix   Mac

Boolean.pm

JSON::DWIW::Boolean - Return a true or false value when evaluated in boolean context -- to be used with JSON::DWIW->encode to explicitly specify a boolean value.`



NAME


 JSON::DWIW::Boolean - Return a true or false value when

                       evaluated in boolean context -- to be used

                       with JSON::DWIW->encode() to explicitly

                       specify a boolean value.`


SYNOPSIS


 use JSON::DWIW;

 my $val1 = JSON::DWIW->true;

 my $val2 = JSON::DWIW->false;

     or

 use JSON::DWIW::Boolean;

 my $val1 = JSON::DWIW::Boolean->new(1); # true value

 my $val2 = JSON::DWIW::Boolean->new(0); # false value


DESCRIPTION


 This module is not intended to be used directly.  It is intended

 to be used as part of JSON::DWIW to specify that a true or false

 value should be output when converting to JSON, since Perl does

 not have explicit values for true and false.

 Overloading is used, so if a JSON::DWIW::Boolean object is

 evaluated in boolean context, it will evaluate to 1 or 0,

 depending on whether the object was initialized to true or false.


METHODS

new($val)


 Return an object initialized with $val as its boolean value.

true()


 Class method that returns a new object initialized to a true value.

false()


 Class method that returns a new object initialized to a false value.


EXAMPLES


DEPENDENCIES


AUTHOR

Don Owens <don@regexguy.com>


LICENSE AND COPYRIGHT

Copyright (c) 2007 Don Owens <don@regexguy.com>. All rights reserved.

This is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See perlartistic.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.


SEE ALSO


VERSION


 0.01
Programminig
Wy
Wy
yW
Wy
Programming
Wy
Wy
Wy
Wy