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

List::Objects::WithUtils::Role::Array::Immutable3pm

Immutable array behavior

Usage

  # Via List::Objects::WithUtils::Array::Immutable ->
  use List::Objects::WithUtils 'immarray';
  my $array = immarray(qw/ a b c /);
  $array->push('d');  # dies

Overview

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

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

  clear
  set
  pop push
  shift unshift
  delete delete_when
  insert
  rotate_in_place
  splice

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

See List::Objects::WithUtils::Array::Immutable for a consumer implementation that also pulls in List::Objects::WithUtils::Role::Array & List::Objects::WithUtils::Role::Array::WithJunctions.

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]>

Licensed under the same terms as Perl.

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