* Ruslan Zakirov <ruz@bestpractical.com> [2013-02-20 13:35]: > grep is a special function with (&@) prototype Only very notionally, not in any way in terms of how it really works. > but this prototype doesn't describe it completly. It doesn't tell > where to lookup $_ (and probably other variables) within the code > block binded to & in the protototype. The block in a `grep` is simply not a function. Consider what this does: sub foo { grep { return; 1 } 1..4 } Then consider what this does: use List::Util 'reduce'; sub foo { reduce { return; 1 } 1..4 } (That difference is one of a number of reasons that Rafaƫl is wrong in his response to me that such lightweight blocks would be useless without lexical $_.) -- Aristotle Pagaltzis // <http://plasmasturm.org/>Thread Previous | Thread Next