readonly
readonly copied to clipboard
@ary = Readonly::Clone @roary gives wrong results
Using Readonly.pm version 2.05 with perl v5.26.1
@ary = Readonly::Clone @roary
returns a single reference to the copied data instead of a list of values. As a result, the cloned array always contains only a single value, namely a ref to the desired values.
I suspect the bug is that the ARRAY case in the code should say
return @$retval if wantarray;
analogous to how it already handles the HASH case.
I'll attach a demo script.