http://www.perlmonks.org?node_id=607299


in reply to Re^3: Should I leave behind beautiful code or readable code?
in thread Should I leave behind beautiful code or readable code?

I realize that some perl coders can't seem to get out of bed in the morning without writing 5 map statements. The map is not that gratuitous here. The arrangement of the code though, with the buried uc() and the odd parentheses, is confusing. Here's a somewhat easier to read re-formatting:
return map { split(' ', uc $_, 2) } @somearray;
I might also break this into two, because the in-line makes the uncommon 3rd arg to split harder to pick up when scanning.
my @separated = map { split(' ', $_, 2) } @somearray; @separated = map { uc $_ } @separated;
Yes, it's probably slower. I don't care about the odd millisecond if it's easier to read. Some decent variable names would also make a big difference here.