Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Robrt (1414)

Robrt
  (email not shown publicly)

robert at perl dot org

Journal of Robrt (1414)

Thursday September 04, 2003
09:33 PM

Contextual

[ #14501 ]

In response to Tassilo von Parseval's query q[What is the point of "foreach", then?] on p5p, Yitzhack Scott-Thoennes said:

call_me_with_void_context($_) foreach @list;
grep call_me_with_scalar_context($_), @list;
map call_me_with_list_context($_), @list;

I think that sums it up beautifully. Someone should use it in a book, or send a patch to the FAQ.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.
  • In response to Tassilo von Parseval's query q[What is the point of "foreach", then?] on p5p,

    Nope, that wasn't me. Kurt Starsinic raised this question.

    I was just the one who sent the patch to speed up the void map.