Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: Addition of hashes

by vinoth.ree (Monsignor)
on Feb 03, 2017 at 07:19 UTC ( [id://1180927]=note: print w/replies, xml ) Need Help??


in reply to Addition of hashes

Using a reference as a number produces an integer representing its storage location in memory. The only useful thing to be done with this is to compare two references numerically to see whether they refer to the same location


All is well. I learn by answering your questions...

Replies are listed 'Best First'.
Re^2: Addition of hashes
by morgon (Priest) on Feb 03, 2017 at 15:30 UTC
    To expand a bit:

    The value of a hashref depends on the context - and not only scalar vs list, but it's different between numeric and string context, e.g.

    perl -e 'print {}' # string-context HASH(0x114dcb8) perl -e 'print 0 + {}' # numeric context 18996408 perl -e '{} + 0' # does not compile syntax error at -e line 1, near "} +"

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (2)
As of 2024-04-26 03:18 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found