in reply to meaning of '@' sigil on a hash?
In Perl5, the sigil represents how the variable should be treated. It does not represent the type of the variable. So just like $ can be used by scalar, arrays and hashes, @ can be used by arrays and hashes.
| select element | select elements (slice) | all keys | all values | all keys & values | |
|---|---|---|---|---|---|
| scalar | $scalar | ||||
| array | $array[$i] | @array[@i] | (0..$#array) | @array | |
| hash | $hash{$i} | @hash{@i} | keys(%hash) | values(%hash) | %hash |
| list | (...)[@i] |
This is all documented in perldata, including slices.
Update: Reordered the columns.
|
|---|