5 ms·
> References are confusing and unnecessary (neither Python nor Ruby needed to make an artifical distinction between references and non-references). Perl refere
by __david__ 13y ago
> References are confusing and unnecessary (neither Python nor Ruby needed to make an artifical distinction between references and non-references).
Perl references combined with its nested list semantics make it extremely convenient to flatten arrays and hashes when you need to. Doing the equivalent in Python and Ruby is verbose and ugly by comparison. I know in Ruby you can get it down to one line, but it lacks the cleanliness of Perl (if you can believe that).
- reality_czech 13y agoFlattening an array is trivial in Ruby: [[1, 2, 3], 4, 5].flatten() I don't see how it could possibly be made easier or more intuitive than a single function call. Ruby also makes it clear what is going on.
- __david__ 13y agoThat flattens everything. In Perl it's trivial to flatten just the parts you need to and leave other nestings intact.