Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: perl strange hash value

by kcott (Canon)
on Sep 08, 2012 at 16:52 UTC ( #992508=note: print w/replies, xml ) Need Help??


in reply to perl strange hash value

As you've shown no code, this is just a guess.

I suspect you've written something like:

$ perl -Mstrict -Mwarnings -E ' my %x; my %y = (a => 1); $x{z} = %y; say $x{z}; ' 1/8

when you really wanted something more like:

$ perl -Mstrict -Mwarnings -E ' my %x; my %y = (a => 1); $x{z} = \%y; say $x{z}; say $x{z}{a}; ' HASH(0x7fba8082b168) 1

Note the assignment of %y in the first example and \%y in the second example.

For a better answer, follow the guidelines in How do I post a question effectively?

-- Ken

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://992508]
help
Chatterbox?
[Corion]: I would assume that the PE format hasn't changed that much since the days of yore, but it seems that I would be wrong in that assumption
[Marshall]: When I bought my copy 15+ years ago, it was just a couple hundred bucks.
[Marshall]: I looked at MS specs for PE format and I didn't see any changes in last decade, but evidenly that would be wrong.

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (10)
As of 2016-12-08 18:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (144 votes). Check out past polls.