for (1..5) { state $n++; say $n } __END__ Prints: 1 2 3 4 5