in reply to loop iterator in a string

If you don't mind using a dash instead of two dots, you might be interested in Set::IntSpan. See the example of its next method in the Synopsis for how to interate through the set. Just don't use the indirect object syntax as it is shown in the documentation, i.e. write Set::IntSpan->new instead of new Set::IntSpan, use $set->insert($n) instead of insert $set $n, and so on.

Replies are listed 'Best First'.
Re^2: loop iterator in a string
by Anonymous Monk on Sep 28, 2021 at 13:20 UTC
    I absolutely love this idea. Thank you for the suggestion!