List::Objects::WithUtils::Array::Immutable - Immutable array objects
use List::Objects::WithUtils 'immarray'; my $array = immarray(qw/ a b c /); my ($head, $rest) = $array->head;
These are immutable array objects; attempting to call list-mutating methods will throw an exception.
On Perls which support it properly, the array is also marked read-only; manually modifying the backing ARRAY reference will also throw an exception.
This class consumes the following roles, which contain most of the relevant documentation:
(See List::Objects::WithUtils::Array for a mutable implementation.)
Creates a new immutable array object.
Jon Portnoy <firstname.lastname@example.org>
Licensed under the same terms as Perl.