Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: meaning of '@' sigil on a hash?

by ikegami (Pope)
on Dec 08, 2007 at 19:19 UTC ( #655867=note: print w/ replies, xml ) Need Help??


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 elementselect elements (slice)all keysall valuesall 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.


Comment on Re: meaning of '@' sigil on a hash?
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://655867]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (7)
As of 2014-07-29 08:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (211 votes), past polls