8 use Scalar::Util qw(refaddr);
17 handles => { array_clone => 'shallow_clone' },
23 handles => { hash_clone => 'shallow_clone' },
29 my $array = [ 1, 2, 3 ];
30 my $hash = { a => 1, b => 2 };
37 my $array_clone = $obj->array_clone;
38 my $hash_clone = $obj->hash_clone;
40 isnt(refaddr($array), refaddr($array_clone), "array clone refers to new copy");
41 is_deeply($array_clone, $array, "...but contents are the same");
42 isnt(refaddr($hash), refaddr($hash_clone), "hash clone refers to new copy");
43 is_deeply($hash_clone, $hash, "...but contents are the same");