Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@ary = Readonly::Clone @roary gives wrong results #32

Open
jimav opened this issue Apr 30, 2018 · 0 comments
Open

@ary = Readonly::Clone @roary gives wrong results #32

jimav opened this issue Apr 30, 2018 · 0 comments

Comments

@jimav
Copy link

jimav commented Apr 30, 2018

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.

demo.pl.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant