in reply to Re^25: Why? (each...)
in thread Why? (each...)
How is knowing that parens are used to override precedence helpful to someone that has trouble remembering whether to use %hash=(a=>1,b=>2) vs. %hash={a=>1,b=>2}?!?
Straw man. The answer I gave to that is "One never uses {} or [] to initialise a hash or array"! I didn't mention parens at all in describing how to initialise a hash. After all, they've got nothing to do with it.
I would mention them in describing how to build a list, though, because they are often needed around list literals.
If I gave you "%hash=(" and asked you what you would normally expect to follow it what would your answer be? Something like "a=>1,b=>2)"??
No. It's definitely a possibility, but I'd often be wrong if I would expect that.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^27: Why? (each...)
by Argel (Prior) on May 19, 2011 at 23:57 UTC | |
by ikegami (Patriarch) on May 20, 2011 at 09:01 UTC | |
by Argel (Prior) on May 20, 2011 at 17:03 UTC | |
by ikegami (Patriarch) on May 20, 2011 at 17:43 UTC | |
by Argel (Prior) on May 20, 2011 at 21:38 UTC | |
|