Subject: | await inside map{} and grep{} |
Currently these forms don't work
async sub {
map { await ... }
}
async sub {
grep { await ... }
}
The reason these don't work is that detecting them at runtime is difficult. map and grep consume two scopestack entries each, however there is no corresponding context stack entry for them, unlike there is for any of the other loop-ish constructs. At suspend time we cannot detect these special kinds of scope entry, and thus at resume time we can't know to put them back in place again.
This is more complex than the documented reason, of localising $_.
--
Paul Evans