2 ms·
> What is the meaning of `@` again? @rray (just like `$` is for $calar, and `%` is for … uhm …). Everything is mnemonic if you have a sufficient amount of con
by JadeNB 8y ago
> What is the meaning of `@` again?
@rray (just like `$` is for $calar, and `%` is for … uhm …). Everything is mnemonic if you have a sufficient amount of context. :-)
- marcosdumay 8y agoThe `@` 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.
- JadeNB 8y ago> 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.)
- lizmat 8y ago<plug> This blog post could be of interest: https://opensource.com/article/18/9/using-sigils-perl-6 https://opensource.com/article/18/9/using-sigils-perl-6 </plug>
- JadeNB 8y agoIn "What they have in common is that they consume the Callable role.", shouldn't 'consume' be 'perform' for consistency with your useage elsewhere?
- 3rdAccount 8y ago"@" 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.
- vram22 8y agoRight. At least, the first two are right: '@' is a stylized 'a' (for 'array') and '$' is a stylized 's' (for 'scalar'). And '%' is a stylized key-value pair, so used for a Perl hash. IIRC. Whatever else you may think of Larry Wall, you can't accuse him of not being ingenious :) >sufficient amount of context. nice('perl pun') unless not intended; https://www.google.co.in/search?q=perl+scalar+and+list+context https://www.google.co.in/search?q=perl+scalar+and+list+conte... https://perldoc.perl.org/functions/unless.html https://perldoc.perl.org/functions/unless.html