http://qs321.pair.com?node_id=1180927


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 "} +"