List::Objects::WithUtils::Role::Hash::Immutable(3pm)

List::Objects::WithUtils::Role::Hash::Immutable3pm

Immutable hash behavior

Usage

  # Via List::Objects::WithUtils::Hash::Immutable ->
  use List::Objects::WithUtils 'immhash';
  my $hash = immhash( foo => 1, bar => 2 );
  $hash->set(foo => 3);  # dies

Overview

This role adds immutable behavior to List::Objects::WithUtils::Role::Hash consumers.

The following methods are not available and will throw an exception:

  clear
  set
  maybe_set
  delete

(The backing hash is also marked read-only.)

See List::Objects::WithUtils::Hash::Immutable for a consumer implementation.

Releases

4 releases since Debian 10 (Buster); the text changed 3 times.

  1. 10
  2. 11
  3. 12
  4. 13

Author

Jon Portnoy <[email protected]>

From liblist-objects-withutils-perl 2.028003-5 in Debian 13 (Trixie). Parsed by carta from the page's man source.