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
|
|---|