How about returning a reference?

Just for test (sorry I have no perl6 installed on local device):

$ perl -le 'sub x {%hash=(1,2,3,4);\%hash}; print x->{1}'
2

Regards.

On Tue, Jan 21, 2020 at 11:56 AM ToddAndMargo via perl6-users <
perl6-us...@perl.org> wrote:

> Hi All,
>
> What is the proper way to state that I am returning a
> hash from a sub?   `sub x() returns % {}`
>
> And an array?  `sub x() returns @ {}`
>
> Many thanks,
> -T
>

Reply via email to