Beefy Boxes and Bandwidth Generously Provided by pair Networks
Just another Perl shrine
 
PerlMonks  

Re: Addition of hashes

by vinoth.ree (Monsignor)
on Feb 03, 2017 at 07:19 UTC ( #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
Node Status?
node history
Node Type: note [id://1180927]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (3)
As of 2020-09-19 04:02 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If at first I donít succeed, I Ö










    Results (114 votes). Check out past polls.

    Notices?