NAME

Venus::Boolean - Boolean Class

ABSTRACT

Boolean Class for Perl 5

SYNOPSIS

package main;

use Venus::Boolean;

my $boolean = Venus::Boolean->new;

# $boolean->negate;

DESCRIPTION

This package provides a representation for boolean values.

INHERITS

This package inherits behaviors from:

Venus::Kind::Value

METHODS

This package provides the following methods:

cast

cast(string $kind) (object | undef)

The cast method converts "value" objects between different "value" object types, based on the name of the type provided. This method will return undef if the invocant is not a Venus::Kind::Value.

Since 0.08

cast example 1
package main;

use Venus::Boolean;

my $boolean = Venus::Boolean->new;

my $cast = $boolean->cast('array');

# bless({ value => [0] }, "Venus::Array")
cast example 2
package main;

use Venus::Boolean;

my $boolean = Venus::Boolean->new;

my $cast = $boolean->cast('boolean');

# bless({ value => 0 }, "Venus::Boolean")
cast example 3
package main;

use Venus::Boolean;

my $boolean = Venus::Boolean->new;

my $cast = $boolean->cast('code');

# bless({ value => sub { ... } }, "Venus::Code")
cast example 4
package main;

use Venus::Boolean;

my $boolean = Venus::Boolean->new;

my $cast = $boolean->cast('float');

# bless({ value => "0.0" }, "Venus::Float")
cast example 5
package main;

use Venus::Boolean;

my $boolean = Venus::Boolean->new;

my $cast = $boolean->cast('hash');

# bless({ value => { "0" => 0 } }, "Venus::Hash")
cast example 6
package main;

use Venus::Boolean;

my $boolean = Venus::Boolean->new;

my $cast = $boolean->cast('number');

# bless({ value => 0 }, "Venus::Number")
cast example 7
package main;

use Venus::Boolean;

my $boolean = Venus::Boolean->new;

my $cast = $boolean->cast('regexp');

# bless({ value => qr/(?^u:0)/ }, "Venus::Regexp")
cast example 8
package main;

use Venus::Boolean;

my $boolean = Venus::Boolean->new;

my $cast = $boolean->cast('scalar');

# bless({ value => \0 }, "Venus::Scalar")
cast example 9
package main;

use Venus::Boolean;

my $boolean = Venus::Boolean->new;

my $cast = $boolean->cast('string');

# bless({ value => 0 }, "Venus::String")
cast example 10
package main;

use Venus::Boolean;

my $boolean = Venus::Boolean->new;

my $cast = $boolean->cast('undef');

# bless({ value => undef }, "Venus::Undef")

default

default() (boolean)

The default method returns the default value, i.e. 0.

Since 0.01

default example 1
# given: synopsis;

my $default = $boolean->default;

# 0

eq

eq(any $arg) (boolean)

The eq method performs an "equals" operation using the argument provided.

Since 0.08

eq example 1
package main;

use Venus::Array;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Array->new;

my $result = $lvalue->eq($rvalue);

# 0
eq example 2
package main;

use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Boolean->new;

my $result = $lvalue->eq($rvalue);

# 1
eq example 3
package main;

use Venus::Code;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Code->new;

my $result = $lvalue->eq($rvalue);

# 0
eq example 4
package main;

use Venus::Float;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Float->new;

my $result = $lvalue->eq($rvalue);

# 1
eq example 5
package main;

use Venus::Hash;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Hash->new;

my $result = $lvalue->eq($rvalue);

# 0
eq example 6
package main;

use Venus::Boolean;
use Venus::Number;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Number->new;

my $result = $lvalue->eq($rvalue);

# 1
eq example 7
package main;

use Venus::Boolean;
use Venus::Regexp;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Regexp->new;

my $result = $lvalue->eq($rvalue);

# 0
eq example 8
package main;

use Venus::Boolean;
use Venus::Scalar;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Scalar->new;

my $result = $lvalue->eq($rvalue);

# 0
eq example 9
package main;

use Venus::Boolean;
use Venus::String;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::String->new;

my $result = $lvalue->eq($rvalue);

# 1
eq example 10
package main;

use Venus::Boolean;
use Venus::Undef;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Undef->new;

my $result = $lvalue->eq($rvalue);

# 1

ge

ge(any $arg) (boolean)

The ge method performs a "greater-than-or-equal-to" operation using the argument provided.

Since 0.08

ge example 1
package main;

use Venus::Array;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Array->new;

my $result = $lvalue->ge($rvalue);

# 0
ge example 2
package main;

use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Boolean->new;

my $result = $lvalue->ge($rvalue);

# 1
ge example 3
package main;

use Venus::Code;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Code->new;

my $result = $lvalue->ge($rvalue);

# 0
ge example 4
package main;

use Venus::Hash;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Hash->new;

my $result = $lvalue->ge($rvalue);

# 0
ge example 5
package main;

use Venus::Boolean;
use Venus::Number;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Number->new;

my $result = $lvalue->ge($rvalue);

# 1
ge example 6
package main;

use Venus::Boolean;
use Venus::Regexp;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Regexp->new;

my $result = $lvalue->ge($rvalue);

# 0
ge example 7
package main;

use Venus::Boolean;
use Venus::Scalar;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Scalar->new;

my $result = $lvalue->ge($rvalue);

# 0
ge example 8
package main;

use Venus::Boolean;
use Venus::String;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::String->new;

my $result = $lvalue->ge($rvalue);

# 1
ge example 9
package main;

use Venus::Boolean;
use Venus::Undef;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Undef->new;

my $result = $lvalue->ge($rvalue);

# 1

gele

gele(any $arg1, any $arg2) (boolean)

The gele method performs a "greater-than-or-equal-to" operation on the 1st argument, and "lesser-than-or-equal-to" operation on the 2nd argument.

Since 0.08

gele example 1
package main;

use Venus::Array;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Array->new;

my $result = $lvalue->gele($rvalue);

# 0
gele example 2
package main;

use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Boolean->new;

my $result = $lvalue->gele($rvalue);

# 1
gele example 3
package main;

use Venus::Code;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Code->new;

my $result = $lvalue->gele($rvalue);

# 0
gele example 4
package main;

use Venus::Float;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Number->new;

my $result = $lvalue->gele($rvalue);

# 1
gele example 5
package main;

use Venus::Hash;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Hash->new;

my $result = $lvalue->gele($rvalue);

# 0
gele example 6
package main;

use Venus::Boolean;
use Venus::Number;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Number->new;

my $result = $lvalue->gele($rvalue);

# 1
gele example 7
package main;

use Venus::Boolean;
use Venus::Regexp;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Regexp->new;

my $result = $lvalue->gele($rvalue);

# 0
gele example 8
package main;

use Venus::Boolean;
use Venus::Scalar;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Scalar->new;

my $result = $lvalue->gele($rvalue);

# 0
gele example 9
package main;

use Venus::Boolean;
use Venus::String;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::String->new;

my $result = $lvalue->gele($rvalue);

# 1
gele example 10
package main;

use Venus::Boolean;
use Venus::Undef;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Undef->new;

my $result = $lvalue->gele($rvalue);

# 1

gt

gt(any $arg) (boolean)

The gt method performs a "greater-than" operation using the argument provided.

Since 0.08

gt example 1
package main;

use Venus::Array;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Array->new;

my $result = $lvalue->gt($rvalue);

# 0
gt example 2
package main;

use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Boolean->new;

my $result = $lvalue->gt($rvalue);

# 0
gt example 3
package main;

use Venus::Code;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Code->new;

my $result = $lvalue->gt($rvalue);

# 0
gt example 4
package main;

use Venus::Float;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Float->new;

my $result = $lvalue->gt($rvalue);

# 0
gt example 5
package main;

use Venus::Hash;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Hash->new;

my $result = $lvalue->gt($rvalue);

# 0
gt example 6
package main;

use Venus::Boolean;
use Venus::Number;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Number->new;

my $result = $lvalue->gt($rvalue);

# 0
gt example 7
package main;

use Venus::Boolean;
use Venus::Regexp;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Regexp->new;

my $result = $lvalue->gt($rvalue);

# 0
gt example 8
package main;

use Venus::Boolean;
use Venus::Scalar;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Scalar->new;

my $result = $lvalue->gt($rvalue);

# 0
gt example 9
package main;

use Venus::Boolean;
use Venus::String;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::String->new;

my $result = $lvalue->gt($rvalue);

# 0
gt example 10
package main;

use Venus::Boolean;
use Venus::Undef;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Undef->new;

my $result = $lvalue->gt($rvalue);

# 0

gtlt

gtlt(any $arg1, any $arg2) (boolean)

The gtlt method performs a "greater-than" operation on the 1st argument, and "lesser-than" operation on the 2nd argument.

Since 0.08

gtlt example 1
package main;

use Venus::Array;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Array->new;

my $result = $lvalue->gtlt($rvalue);

# 0
gtlt example 2
package main;

use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Boolean->new;

my $result = $lvalue->gtlt($rvalue);

# 0
gtlt example 3
package main;

use Venus::Code;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Code->new;

my $result = $lvalue->gtlt($rvalue);

# 0
gtlt example 4
package main;

use Venus::Float;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Float->new;

my $result = $lvalue->gtlt($rvalue);

# 0
gtlt example 5
package main;

use Venus::Hash;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Hash->new;

my $result = $lvalue->gtlt($rvalue);

# 0
gtlt example 6
package main;

use Venus::Boolean;
use Venus::Number;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Number->new;

my $result = $lvalue->gtlt($rvalue);

# 0
gtlt example 7
package main;

use Venus::Boolean;
use Venus::Regexp;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Regexp->new;

my $result = $lvalue->gtlt($rvalue);

# 0
gtlt example 8
package main;

use Venus::Boolean;
use Venus::Scalar;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Scalar->new;

my $result = $lvalue->gtlt($rvalue);

# 0
gtlt example 9
package main;

use Venus::Boolean;
use Venus::String;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::String->new;

my $result = $lvalue->gtlt($rvalue);

# 0
gtlt example 10
package main;

use Venus::Boolean;
use Venus::Undef;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Undef->new;

my $result = $lvalue->gtlt($rvalue);

# 0

is_false

is_false() (boolean)

The is_false method returns false if the boolean is falsy, otherwise returns true.

Since 0.01

is_false example 1
# given: synopsis;

my $is_false = $boolean->is_false;

# 1

is_true

is_true() (boolean)

The is_true method returns true if the boolean is truthy, otherwise returns false.

Since 0.01

is_true example 1
# given: synopsis;

my $is_true = $boolean->is_true;

# 0

le

le(any $arg) (boolean)

The le method performs a "lesser-than-or-equal-to" operation using the argument provided.

Since 0.08

le example 1
package main;

use Venus::Array;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Array->new;

my $result = $lvalue->le($rvalue);

# 1
le example 2
package main;

use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Boolean->new;

my $result = $lvalue->le($rvalue);

# 1
le example 3
package main;

use Venus::Code;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Code->new;

my $result = $lvalue->le($rvalue);

# 1
le example 4
package main;

use Venus::Float;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Float->new;

my $result = $lvalue->le($rvalue);

# 1
le example 5
package main;

use Venus::Hash;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Hash->new;

my $result = $lvalue->le($rvalue);

# 1
le example 6
package main;

use Venus::Boolean;
use Venus::Number;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Number->new;

my $result = $lvalue->le($rvalue);

# 1
le example 7
package main;

use Venus::Boolean;
use Venus::Regexp;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Regexp->new;

my $result = $lvalue->le($rvalue);

# 1
le example 8
package main;

use Venus::Boolean;
use Venus::Scalar;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Scalar->new;

my $result = $lvalue->le($rvalue);

# 1
le example 9
package main;

use Venus::Boolean;
use Venus::String;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::String->new;

my $result = $lvalue->le($rvalue);

# 1
le example 10
package main;

use Venus::Boolean;
use Venus::Undef;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Undef->new;

my $result = $lvalue->le($rvalue);

# 1

lt

lt(any $arg) (boolean)

The lt method performs a "lesser-than" operation using the argument provided.

Since 0.08

lt example 1
package main;

use Venus::Array;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Array->new;

my $result = $lvalue->lt($rvalue);

# 1
lt example 2
package main;

use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Boolean->new;

my $result = $lvalue->lt($rvalue);

# 0
lt example 3
package main;

use Venus::Code;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Code->new;

my $result = $lvalue->lt($rvalue);

# 1
lt example 4
package main;

use Venus::Float;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Float->new;

my $result = $lvalue->lt($rvalue);

# 0
lt example 5
package main;

use Venus::Hash;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Hash->new;

my $result = $lvalue->lt($rvalue);

# 1
lt example 6
package main;

use Venus::Boolean;
use Venus::Number;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Number->new;

my $result = $lvalue->lt($rvalue);

# 0
lt example 7
package main;

use Venus::Boolean;
use Venus::Regexp;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Regexp->new;

my $result = $lvalue->lt($rvalue);

# 1
lt example 8
package main;

use Venus::Boolean;
use Venus::Scalar;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Scalar->new;

my $result = $lvalue->lt($rvalue);

# 1
lt example 9
package main;

use Venus::Boolean;
use Venus::String;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::String->new;

my $result = $lvalue->lt($rvalue);

# 0
lt example 10
package main;

use Venus::Boolean;
use Venus::Undef;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Undef->new;

my $result = $lvalue->lt($rvalue);

# 0

ne

ne(any $arg) (boolean)

The ne method performs a "not-equal-to" operation using the argument provided.

Since 0.08

ne example 1
package main;

use Venus::Array;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Array->new;

my $result = $lvalue->ne($rvalue);

# 1
ne example 2
package main;

use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Boolean->new;

my $result = $lvalue->ne($rvalue);

# 0
ne example 3
package main;

use Venus::Code;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Code->new;

my $result = $lvalue->ne($rvalue);

# 1
ne example 4
package main;

use Venus::Float;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Float->new;

my $result = $lvalue->ne($rvalue);

# 0
ne example 5
package main;

use Venus::Hash;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Hash->new;

my $result = $lvalue->ne($rvalue);

# 1
ne example 6
package main;

use Venus::Boolean;
use Venus::Number;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Number->new;

my $result = $lvalue->ne($rvalue);

# 0
ne example 7
package main;

use Venus::Boolean;
use Venus::Regexp;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Regexp->new;

my $result = $lvalue->ne($rvalue);

# 1
ne example 8
package main;

use Venus::Boolean;
use Venus::Scalar;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Scalar->new;

my $result = $lvalue->ne($rvalue);

# 1
ne example 9
package main;

use Venus::Boolean;
use Venus::String;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::String->new;

my $result = $lvalue->ne($rvalue);

# 0
ne example 10
package main;

use Venus::Boolean;
use Venus::Undef;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Undef->new;

my $result = $lvalue->ne($rvalue);

# 0

negate

negate() (boolean)

The negate method returns true if the boolean is falsy, otherwise returns false.

Since 0.01

negate example 1
# given: synopsis;

my $negate = $boolean->negate;

# 1

numified

numified() (number)

The numified method returns the numerical representation of the object.

Since 0.08

numified example 1
# given: synopsis;

my $numified = $boolean->numified;

# 1
numified example 2
package main;

use Venus::Boolean;

my $boolean = Venus::Boolean->new(0);

my $numified = $boolean->numified;

# 0
numified example 3
package main;

use Venus::Boolean;

my $boolean = Venus::Boolean->new(1);

my $numified = $boolean->numified;

# 1

string

string() (string)

The string method returns the word 'true' if the boolean is truthy, otherwise returns 'false'. This method was formerly named "type".

Since 0.08

string example 1
# given: synopsis;

my $string = $boolean->string;

# "false"

tv

tv(any $arg) (boolean)

The tv method performs a "type-and-value-equal-to" operation using argument provided.

Since 0.08

tv example 1
package main;

use Venus::Array;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Array->new;

my $result = $lvalue->tv($rvalue);

# 0
tv example 2
package main;

use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Boolean->new;

my $result = $lvalue->tv($rvalue);

# 1
tv example 3
package main;

use Venus::Code;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Code->new;

my $result = $lvalue->tv($rvalue);

# 0
tv example 4
package main;

use Venus::Float;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Float->new;

my $result = $lvalue->tv($rvalue);

# 0
tv example 5
package main;

use Venus::Hash;
use Venus::Boolean;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Hash->new;

my $result = $lvalue->tv($rvalue);

# 0
tv example 6
package main;

use Venus::Boolean;
use Venus::Number;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Number->new;

my $result = $lvalue->tv($rvalue);

# 0
tv example 7
package main;

use Venus::Boolean;
use Venus::Regexp;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Regexp->new;

my $result = $lvalue->tv($rvalue);

# 0
tv example 8
package main;

use Venus::Boolean;
use Venus::Scalar;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Scalar->new;

my $result = $lvalue->tv($rvalue);

# 0
tv example 9
package main;

use Venus::Boolean;
use Venus::String;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::String->new;

my $result = $lvalue->tv($rvalue);

# 0
tv example 10
package main;

use Venus::Boolean;
use Venus::Undef;

my $lvalue = Venus::Boolean->new;
my $rvalue = Venus::Undef->new;

my $result = $lvalue->tv($rvalue);

# 0

OPERATORS

This package overloads the following operators:

operation: (!)

This package overloads the ! operator.

example 1

# given: synopsis;

my $result = !$boolean;

# 1
operation: (!=)

This package overloads the != operator.

example 1

# given: synopsis;

my $result = $boolean != 1;

# 1
operation: (==)

This package overloads the == operator.

example 1

# given: synopsis;

my $result = $boolean == 0;

# 1
operation: (>)

This package overloads the > operator.

example 1

# given: synopsis;

my $result = $boolean > 0;

# 0
operation: (>=)

This package overloads the >= operator.

example 1

# given: synopsis;

my $result = $boolean >= 0;

# 1
operation: (<)

This package overloads the < operator.

example 1

# given: synopsis;

my $result = $boolean < 1;

# 1
operation: (<=)

This package overloads the <= operator.

example 1

# given: synopsis;

my $result = $boolean <= 0;

# 1
operation: (bool)

This package overloads the bool operator.

example 1

# given: synopsis;

my $result = !!$boolean;

# 0
operation: (eq)

This package overloads the eq operator.

example 1

# given: synopsis;

my $result = $boolean eq '0';

# 1
operation: (ne)

This package overloads the ne operator.

example 1

# given: synopsis;

my $result = $boolean ne '1';

# 1
operation: (qr)

This package overloads the qr operator.

example 1

# given: synopsis;

my $result = '0' =~ qr/$boolean/;

# 1

AUTHORS

Awncorp, awncorp@cpan.org

LICENSE

Copyright (C) 2000, Awncorp, awncorp@cpan.org.

This program is free software, you can redistribute it and/or modify it under the terms of the Apache license version 2.0.