in reply to pointy counters

This works without any module:
my $c = 10; print "$c\n" while $c --> 0;

Replies are listed 'Best First'.
Re^2: pointy counters
by tobyink (Canon) on Dec 21, 2011 at 10:18 UTC

    Yeah, counting backwards works without needing Pointy::Counter. That's why Pointy::Counter only offers support for counting forwards.


      I do not even understand the topic nor the syntax
      perl -e "my $c = 10; print qq!$c\n! while $c --> 0;"
      but I see that also
      perl -e "my $c = 10; print qq!$c\n! while $c ++> 0 && $c < 100;"
      runs fine.. BUT what a notation is this --> or ++> ?
      there are no rules, there are no thumbs..
        --> is the autodecrement followed by a greater than. It looks like the arrow operator used in various languages, but while $c --> 0is really just while ($c--) > 0