3 ms·
> print "[", +( join '', map { "-> $_" } @$_ ), "]" for @{$ref} Because computers are so slow, memory is so limited and disk space is so expensive the program
by notyourday 6y ago
> print "[", +( join '', map { "-> $_" } @$_ ), "]" for @{$ref}
Because computers are so slow, memory is so limited and disk space is so expensive the programmer absolutely had to write it in a single line in the most convoluted way possible? Yeah, that's definitely a language fault.
- ricardobeat 6y agoThis is pretty idiomatic Perl, and I've seen similar constructs countless times at work. You could indent the map body but it normally wouldn't be done for such a short expression. There is not much room for maneuver there if you don't want intermediate variables. And this is a quick sample, there is much, much hairier stuff to be found in real code. "Knowing the language well" is seen as a virtue for many.