Miko O'Sullivan wrote: > > SUMMARY > > A proposal for a set of loop structures that simplify code that is based on > loop iterations. > > foreach my $var (@arr) { ... } > before { ... } # run before first iteration, > # only if there is at least one iteration
Larry is still considering allowing a C<FIRST> block that would do this. It would go inside the loop block. > between { ... } # run between iterations, not before first or after last This will be called a C<NEXT> block. It goes inside the loop block. > after { ... } # run after last iteration, > # only if there is at least one iteration This will be called a C<LAST> block. It goes inside the loop block. > noloop { ... } # run if there are no iterations Larry has been mulling over whether various types of loop should be allowed to take C<else> blocks to accomplish this. Damian