dsb has asked for the wisdom of the Perl Monks concerning the following question:
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'
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Hash to Scalar Assignment Oddity
by philcrow (Priest) on Jan 26, 2006 at 15:34 UTC | |
|
Re: Hash to Scalar Assignment Oddity
by bunnyman (Hermit) on Jan 26, 2006 at 18:12 UTC | |
by revdiablo (Prior) on Jan 26, 2006 at 20:56 UTC | |
by dsb (Chaplain) on Jan 30, 2006 at 21:00 UTC | |
by bunnyman (Hermit) on Feb 08, 2006 at 19:06 UTC | |
|
Re: Hash to Scalar Assignment Oddity
by borisz (Canon) on Jan 26, 2006 at 15:47 UTC | |
|
Re: Hash to Scalar Assignment Oddity
by ikegami (Patriarch) on Jan 26, 2006 at 17:16 UTC |