in reply to Perl modulus not working

Actually, apart from the obvious bug in the code, there are alternative ways of doing what you are attempting to do here. A possible alternative would be to use Damian Conway's Smart:Comments module. See below:

use Modern::Perl; use Smart::Comments; my $cnt = 0; for (0 .. 999_999) { ### Processing===[%] done $cnt++; sleep(.5); } say "Finished!"

Now you really need to run this code from the command line to appreciate just how much you get for free when using this module, especially for what you are trying to do...