use threads::shared; my $ref = &share({}); $ref->{a} = &share([]); $ref->{a}[0] = something;