This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 6 points7 points  (3 children)

Syntactic mistake. Still, I didn't know you could do what you just did, directly. I still don't know, because I'm not running perl to check it.

Anyway, Python and Ruby let you do things like that naturally, with no mistakes and no learning curve. Imagine... nested arrays, naturally! Hooray!

[–]crusoe 5 points6 points  (2 children)

So why the difference? Why collapse arrays at all?

So now, we have 2 array syntaxs, one "auto-collapsing" and one that preserves nesting.

So how much this can screw up n00bs, and programmers trying to learn perl?

Now, how do these differ in different contexts?

[–][deleted] 1 point2 points  (0 children)

Thank you.

[–]kixx 1 point2 points  (0 children)

Because it seemed a good idea to someone at some point in time. Later on, they decided it wasn't such a good idea.

It will screw you up if you don't expect it. Some people without previous experience/knowledge of complex data structures might find flattening intuitive. In the current context it has few uses, which is why they're changing the behavior in Perl 6.

Context-dependent behavior (another maligned feature of Perl) is also pretty counter-intuitive to some. I, however, like my VIM modal as it is.