Data::Perl::Role::Bool(3pm)

Data::Perl::Role::Bool3pm

Wrapping class for boolean values.

Usage

  use Data::Perl qw/bool/;
  my $bool = bool(0);
  $bool->toggle; # 1
  $bool->unset; # 0

Version

version 0.002011

Overview

This class provides a wrapper and methods for interacting with boolean values.

Provided methods

None of these methods accept arguments.

new($value)

Constructs a new Data::Perl::Collection::Bool object initialized with the passed in value, and returns it.

set

Sets the value to 1 and returns 1.

unset

Set the value to 0 and returns 0.

toggle

Toggles the value. If it's true, set to false, and vice versa.

Returns the new value.

not

Equivalent of 'not $value'.

Releases

7 releases since Debian 8 (Jessie); the text changed 4 times.

  1. 8–9
  2. 10
  3. 11
  4. 12–13
  5. Arch

Author

Matthew Phillips <[email protected]>

From perl-data-perl 0.002011-8 in Arch Linux 2026-11-01. Parsed by carta from the page's man source.