This method accepts one or two arguments.
+=item B<shallow_clone>
+
+This method returns a shallow clone of the array reference. The return value
+is a reference to a new array with the same elements. It is I<shallow>
+because any elements that were references in the original will be the I<same>
+references in the clone.
+
=back
=head1 BUGS
When called as a setter, this method returns the value that was set.
+=item B<shallow_clone>
+
+This method returns a shallow clone of the hash reference. The return value
+is a reference to a new hash with the same keys and values. It is I<shallow>
+because any values that were references in the original will be the I<same>
+references in the clone.
+
=back
Note that C<each> is deliberately omitted, due to its stateful interaction
--- /dev/null
+package Moose::Meta::Method::Accessor::Native::Array::shallow_clone;
+
+use strict;
+use warnings;
+
+use Params::Util ();
+
+use Moose::Role;
+
+with 'Moose::Meta::Method::Accessor::Native::Reader' => {
+ -excludes => [
+ qw(
+ _minimum_arguments
+ _maximum_arguments
+ )
+ ]
+};
+
+sub _minimum_arguments { 0 }
+
+sub _maximum_arguments { 0 }
+
+sub _return_value {
+ my $self = shift;
+ my ($slot_access) = @_;
+
+ return '[ @{ (' . $slot_access . ') } ]';
+}
+
+no Moose::Role;
+
+1;
--- /dev/null
+package Moose::Meta::Method::Accessor::Native::Hash::shallow_clone;
+
+use strict;
+use warnings;
+
+use Params::Util ();
+
+use Moose::Role;
+
+with 'Moose::Meta::Method::Accessor::Native::Reader' => {
+ -excludes => [
+ qw(
+ _minimum_arguments
+ _maximum_arguments
+ )
+ ]
+};
+
+sub _minimum_arguments { 0 }
+
+sub _maximum_arguments { 0 }
+
+sub _return_value {
+ my $self = shift;
+ my ($slot_access) = @_;
+
+ return '{ %{ (' . $slot_access . ') } }';
+}
+
+no Moose::Role;
+
+1;
--- /dev/null
+#!/usr/bin/perl
+
+use strict;
+use warnings;
+
+use Test::More;
+use Test::Fatal;
+use Scalar::Util qw(refaddr);
+
+{
+ package Foo;
+ use Moose;
+
+ has 'array' => (
+ traits => ['Array'],
+ is => 'ro',
+ handles => { array_clone => 'shallow_clone' },
+ );
+
+ has 'hash' => (
+ traits => ['Hash'],
+ is => 'ro',
+ handles => { hash_clone => 'shallow_clone' },
+ );
+
+ no Moose;
+}
+
+my $array = [ 1, 2, 3 ];
+my $hash = { a => 1, b => 2 };
+
+my $obj = Foo->new({
+ array => $array,
+ hash => $hash,
+});
+
+my $array_clone = $obj->array_clone;
+my $hash_clone = $obj->hash_clone;
+
+isnt(refaddr($array), refaddr($array_clone), "array clone refers to new copy");
+is_deeply($array_clone, $array, "...but contents are the same");
+isnt(refaddr($hash), refaddr($hash_clone), "hash clone refers to new copy");
+is_deeply($hash_clone, $hash, "...but contents are the same");
+
+done_testing;