- or download this
D:\dev>perl -e"do { next };"
Can't "next" outside a loop block at -e line 1.
D:\dev>perl -e"{ next };"
- or download this
BEGIN {
my $count=0; # static
...
for (0..9) {
print counter();
}
- or download this
sub make_counter {
my $start=shift||0;
return sub {$start++};
}