The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.
#!perl -w

use strict;
use warnings FATAL => 'all';

use Test::More;

use Data::Clone;

for(1 .. 2){ # do it twice to test internal data

    my $s = 'foobar';
    my @a = (\substr $s, 1, 2);
    my $c = clone(\@a);

    is ${$c->[0]}, 'oo';
    ${$c->[0]} = 'xx';

    is $s, 'fxxbar', 'ScalarRef is copied in surface';
}

done_testing;