Countdown Timer for Webmin run.cgi using perl

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
0
down vote

favorite












I have a perl script that has a countdown timer subroutine that, when ran from a terminal session, overwrites the displayed remaining time every second with the current time remaining. But, when it is ran via webmin run.cgi in a browser, it does NOT overwrite the previous time, it just moves one space to the right of the previous time and writes the new current time remaining to the run.cgi.



Example output to webmin run.cgi in browser:



00:00:58 00:00:57 00:00:56 00:00:55 00:00:54 00:00:53 00:00:52 00:00:51 00:00:50 00:00:49 00:00:48 00:00:47 00:00:46 00:00:45 00:00:44 00:00:43 00:00:42 00:00:41 00:00:40 00:00:39 00:00:38 00:00:37 00:00:36 00:00:35 00:00:34 00:00:33 00:00:32 00:00:31 00:00:30 00:00:29 00:00:28 00:00:27 00:00:26



Countdown timer code:



sub reload_router = 1;
my $beg_time = time;
my $end_time = $beg_time + $countdown;

for (;;) ++;
sleep(1);


print("rReboot Completed!n");



I have a PDF and PNG screenshot of the output if that would help, but I don't have access to an external image repository where I can upload it.










share|improve this question



























    up vote
    0
    down vote

    favorite












    I have a perl script that has a countdown timer subroutine that, when ran from a terminal session, overwrites the displayed remaining time every second with the current time remaining. But, when it is ran via webmin run.cgi in a browser, it does NOT overwrite the previous time, it just moves one space to the right of the previous time and writes the new current time remaining to the run.cgi.



    Example output to webmin run.cgi in browser:



    00:00:58 00:00:57 00:00:56 00:00:55 00:00:54 00:00:53 00:00:52 00:00:51 00:00:50 00:00:49 00:00:48 00:00:47 00:00:46 00:00:45 00:00:44 00:00:43 00:00:42 00:00:41 00:00:40 00:00:39 00:00:38 00:00:37 00:00:36 00:00:35 00:00:34 00:00:33 00:00:32 00:00:31 00:00:30 00:00:29 00:00:28 00:00:27 00:00:26



    Countdown timer code:



    sub reload_router = 1;
    my $beg_time = time;
    my $end_time = $beg_time + $countdown;

    for (;;) ++;
    sleep(1);


    print("rReboot Completed!n");



    I have a PDF and PNG screenshot of the output if that would help, but I don't have access to an external image repository where I can upload it.










    share|improve this question

























      up vote
      0
      down vote

      favorite









      up vote
      0
      down vote

      favorite











      I have a perl script that has a countdown timer subroutine that, when ran from a terminal session, overwrites the displayed remaining time every second with the current time remaining. But, when it is ran via webmin run.cgi in a browser, it does NOT overwrite the previous time, it just moves one space to the right of the previous time and writes the new current time remaining to the run.cgi.



      Example output to webmin run.cgi in browser:



      00:00:58 00:00:57 00:00:56 00:00:55 00:00:54 00:00:53 00:00:52 00:00:51 00:00:50 00:00:49 00:00:48 00:00:47 00:00:46 00:00:45 00:00:44 00:00:43 00:00:42 00:00:41 00:00:40 00:00:39 00:00:38 00:00:37 00:00:36 00:00:35 00:00:34 00:00:33 00:00:32 00:00:31 00:00:30 00:00:29 00:00:28 00:00:27 00:00:26



      Countdown timer code:



      sub reload_router = 1;
      my $beg_time = time;
      my $end_time = $beg_time + $countdown;

      for (;;) ++;
      sleep(1);


      print("rReboot Completed!n");



      I have a PDF and PNG screenshot of the output if that would help, but I don't have access to an external image repository where I can upload it.










      share|improve this question















      I have a perl script that has a countdown timer subroutine that, when ran from a terminal session, overwrites the displayed remaining time every second with the current time remaining. But, when it is ran via webmin run.cgi in a browser, it does NOT overwrite the previous time, it just moves one space to the right of the previous time and writes the new current time remaining to the run.cgi.



      Example output to webmin run.cgi in browser:



      00:00:58 00:00:57 00:00:56 00:00:55 00:00:54 00:00:53 00:00:52 00:00:51 00:00:50 00:00:49 00:00:48 00:00:47 00:00:46 00:00:45 00:00:44 00:00:43 00:00:42 00:00:41 00:00:40 00:00:39 00:00:38 00:00:37 00:00:36 00:00:35 00:00:34 00:00:33 00:00:32 00:00:31 00:00:30 00:00:29 00:00:28 00:00:27 00:00:26



      Countdown timer code:



      sub reload_router = 1;
      my $beg_time = time;
      my $end_time = $beg_time + $countdown;

      for (;;) ++;
      sleep(1);


      print("rReboot Completed!n");



      I have a PDF and PNG screenshot of the output if that would help, but I don't have access to an external image repository where I can upload it.







      perl webmin cgi






      share|improve this question















      share|improve this question













      share|improve this question




      share|improve this question








      edited 14 mins ago









      Rui F Ribeiro

      37.8k1475120




      37.8k1475120










      asked 30 mins ago









      PCnetMD

      6




      6

























          active

          oldest

          votes











          Your Answer







          StackExchange.ready(function()
          var channelOptions =
          tags: "".split(" "),
          id: "106"
          ;
          initTagRenderer("".split(" "), "".split(" "), channelOptions);

          StackExchange.using("externalEditor", function()
          // Have to fire editor after snippets, if snippets enabled
          if (StackExchange.settings.snippets.snippetsEnabled)
          StackExchange.using("snippets", function()
          createEditor();
          );

          else
          createEditor();

          );

          function createEditor()
          StackExchange.prepareEditor(
          heartbeatType: 'answer',
          convertImagesToLinks: false,
          noModals: false,
          showLowRepImageUploadWarning: true,
          reputationToPostImages: null,
          bindNavPrevention: true,
          postfix: "",
          onDemand: true,
          discardSelector: ".discard-answer"
          ,immediatelyShowMarkdownHelp:true
          );



          );













           

          draft saved


          draft discarded


















          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f478724%2fcountdown-timer-for-webmin-run-cgi-using-perl%23new-answer', 'question_page');

          );

          Post as a guest



































          active

          oldest

          votes













          active

          oldest

          votes









          active

          oldest

          votes






          active

          oldest

          votes















           

          draft saved


          draft discarded















































           


          draft saved


          draft discarded














          StackExchange.ready(
          function ()
          StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f478724%2fcountdown-timer-for-webmin-run-cgi-using-perl%23new-answer', 'question_page');

          );

          Post as a guest