dsb has asked for the wisdom of the Perl Monks concerning the following question:
A coworker and I were trying to work out some of the code when tie'ing a hash to a Berkeley DB file. I noticed that one of the lines called for the return value from a tie() to be assigned to a scalar variable. So I tried assigning a regular old hash - not a reference to a hash - to a scalar. I didn't get what i expected.
dsb
This @ISA my( $cool ) %SIG
I half expected the code to bomb. Instead the assignment evaluated and when I printed the contents of the scalar, I got a weird result. See the code.
Anyone have an idea of what's going on here and why I get a fraction when I print the contents of $db?%db = ( one => 1, two => 2, three => 3 ); print %db, "\n"; # prints 'three3one1two2' $db = %db; print $db, "\n"; # prints '3/8'
dsb
This @ISA my( $cool ) %SIG
Back to
Seekers of Perl Wisdom