in reply to Unwanted cloning of array elements

Why. it's your basic coping with scoping issue. You've got  my $piece; outside the loop