3 ms·
- weird sigil rules where the 0 element of @x is $x[0] not @x[0] '@' and '%' indicate containers, while '$' is a scalar (which containers can contain). So '$x[
by kwoff 11mo ago
- weird sigil rules where the 0 element of @x is $x[0] not @x[0]
'@' and '%' indicate containers, while '$' is a scalar (which containers can contain). So '$x[0]' is referring to a scalar within the '@x' container. If you operate on a container, like 'push @x, 2', it uses the container sigil.
I guess "weird" triggered me a bit, heh. I know it's subjective.
- cowboylowrez 11mo agohaha even your explanation looks 'write only'
- lupire 11mo agoSigils are essentially type tags. That's it. Array x === @x Int x[0] === $x[0]