2 ms·
My production style is happy to use: $output *= $_ for (1..$n) and you're right to call me on it. If I am writing a multi-line for loop, I do like to name
by jbert 14y ago
My production style is happy to use:
$output *= $_ for (1..$n)
and you're right to call me on it. If I am writing a multi-line for loop, I do like to name the loop var though.
I think this is an interesting point (in a discussion about readability), do non-perl coders think the one-liner (with 'for' suffix) is more or less readable?
(I also prefer explicit return for maintenance reasons, except possibly in one-line subs)