in reply to All in one

In many cases, the second statement will require the programmer to assign a value to a temp variable. This can be avoided by merging two statements into a single one. This may or may not save memory or speed, depending on a number of details (like if they're returning an array vs. an arrayref). It may look particularly good for large list processing, such as with the Schwarzian Transform.

I am not completely convinced if this is a bad thing to strive for or not. If anything, the programmer may learn something about the expressiveness of the languge in question, which carries its own reward.

As an example, I've started using this idiom for filling HTML::Template loops based on Class::DBI objects:

# $tmpl and @search_results defined elsewhere $tmpl->param( loop => [ map {{ col1 => $_->col1, col2 => $_->col2, col3 => $_->col3, }} @search_results ]);

Very expressive, and I think the double-curly looks sexy :)

----
I wanted to explore how Perl's closures can be manipulated, and ended up creating an object system by accident.
-- Schemer

: () { :|:& };:

Note: All code is untested, unless otherwise stated