This is the trick used by Calc.yp in the Parse::Yapp distribution. It indeed creates an alias but conveys the wrong message because the the block is not really used as a loop.
| [reply] [Watch: Dir/Any] |
That's why I wished Perl allowed another keyword as yet another synonym for for/foreach — I'd propose "with", for example:
with($$s) {
...
}
But in the meantime, I've trained myself to actually read/see
for(SCALAR) { ... }
as
with(SCALAR) { ... }
Chalk it up as another Perl idiom.
| [reply] [Watch: Dir/Any] [d/l] [select] |
| [reply] [Watch: Dir/Any] |
Much like in English, you can use Perl's for() for iterating over a list, iterating via initialization + check + step, or associating a single topic with a block of syntax. So I, without apology, use for() for topicalizing. For you, I won't stop doing this. (: Excuse me for not demonstrating the use of English "for" analogous to init + check + step.
| [reply] [Watch: Dir/Any] |