Hacker News new | ask | show | jobs
by kwoff 211 days 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.

1 comments

haha even your explanation looks 'write only'
Sigils are essentially type tags. That's it.

Array x === @x

Int x[0] === $x[0]