See Original text in context
Similar to the $
variable, there is also a Positional anonymous state variable @
.
sub foo()foo() for ^3;# OUTPUT: «[0]# [0 1]# [0 1 2]»
The @
here is parenthesized in order to disambiguate the expression from a class member variable named @.push
. Indexed access doesn't require this disambiguation but you will need to copy the value in order to do anything useful with it.
sub foo()foo() for ^3;# OUTPUT: «[0]# [0 1]# [0 1 2]»
As with $
, each mention of @
in a scope introduces a new anonymous array.