Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The `@` symbol is a variable by itself, what is very clear from it's name, even more because `$` certainly isn't and I also don't think `%` is one (that last is for dictionaries, by the way).

Another system defined variable is `$_`, that is as well named as the one I cited.

There are many more of those in Perl, but I can't remember them for some reason.



> The `@` symbol is a variable by itself, what is very clear from it's name

I'm almost certain that this is false, at least in Perl 5. (Sigils are dramatically overhauled in Perl 6, and I haven't kept up.)


<plug>

This blog post could be of interest: https://opensource.com/article/18/9/using-sigils-perl-6

</plug>


In "What they have in common is that they consume the Callable role.", shouldn't 'consume' be 'perform' for consistency with your useage elsewhere?


"@" is for an array variable or pulling something in array context. You can have variables declared with $, @, or % depending on whether it is a scalar, array, or hash structure.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: