in reply to How do I pause real time in Perl

Among the activities which can help you to understand more are:
  1. use strict; use warnings; they're there to help you find typos and other mistakes. Generally, they're a new Perl programmers 2nd best friend (in line right behind perldoc [-c function] | &$91;module&93;) and in this case, were you to replace your printf statement with three separate print statements you'd discovered some problems.
  2. Next time, READ the instructions around the text box where you enter your node). Where you a registered user you could see those instructions immediately below the rendered text were you to re-visit another of the nodes created after registering.
  3. Consider why you have chose to multiply 1*60 and to calculate 60%60 (Hint 1: one times anything is what? Hint 2: anything modulus itself is what?).

Run this (it's --mostly-- not a 'how-to' but rather an illustration of 'how-not-to-do-it.'); chew on what you see as output for a bit:

(mostly) BAAAD CODE! #!/usr/bin/perl use 5.016; # implicit use strict; with recent vers +ions of perl use warnings; # 1060823 my $countdown = 1*60; # 60 seconds $| = 1; # disable output buffering my $start_time = time; # use the time function (see perldoc - +f time) say "\t \$start_time: $start_time"; my $end_time = $start_time + $countdown; for (;;) { # empty for clause my $time = time; say $time; last if ($time >= $end_time); # printf("\r%02d:%02d:%02d", ($end_time - $time) / (1*60); ($end_t +ime - $time) / 60%60, ($end_time - $time) % 60); say "Ln 19: " . (($end_time - $time) / (1*60)); say " Ln 20: " . (($end_time - $time) / 60%60); say " Ln 23: " .(($end_time - $time) % 60); sleep(1); }

Questions? C'mon back with those you can't answer for yourself from the relevant documents, Tutorials here, etc. You'll get quick and friendly responses.