Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re: Is this a hash?

by davido (Cardinal)
on Jun 16, 2015 at 14:29 UTC ( [id://1130618]=note: print w/replies, xml ) Need Help??


in reply to Is this a hash?

$thing will contain a hash reference, or more precisely, a reference to an anonymous hash constructed by the { ... } operator, which in this usage is a hash reference constructor.

You can refer to the hash as a reference ($thing), or as a hash (%{$thing} or %$thing), and you may refer to its individual elements by dereferencing it: $thing->{'a'}.

This would be a named hash:

my %thing = ( a => $a, b => $b, );

Dave

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others rifling through the Monastery: (2)
As of 2024-04-19 19:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found