Skip to content

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

@jimav

Description

@jimav

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions