in reply to Re: Porting tqdm to Perl (updated)
in thread Porting tqdm to Perl

Yes, creating an iterator (either a full object or just a coderef) would be one of the obvious choices. Overloading the diamond operator is interesting, thanks for pointing that out. Sadly, all these are still far from the "just add 4+2 characters to do progress bar" that the Python's tqdm libary enables.

As someone wrote in How to Write Perfect Python Command-line Interfaces — Learn by Example: "Do you see any difference? It is not so easy to spot because the difference consists of 4 letters: TQDM. (...) This is the name of a Python library and this is the name of its unique class, with which you wrap any iterable to print the corresponding progression. (...) And this results in a beautiful progress bar. Personally, I still find it too good to be true."

It's seldom that I feel Python envy, but this is one of those moments :-)