use Pointy::Counter; my $i = counter; while ($i --> 10) { print "Counter is $i\n"; }
This achieved via some fairly basic (albeit unintuitive) use of overloading. See https://metacpan.org/release/TOBYINK/Pointy-Counter-0.001.
I really need to investigate here to see how feasible it would be to achieve syntax like this:
use Pointy::Counter; while (ctr $i --> 10) { print "Counter is $i\n"; }
In reply to pointy counters by tobyink
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |