in reply to Re: Re: Refresh display in Perl
in thread Refresh display in Perl

Uh... Yes... But that makes your one-liner longer and saving the overhead of calling clear really isn't worth it.

-sauoq
"My two cents aren't worth a dime.";

Replies are listed 'Best First'.
Re: Refresh display in Perl
by Coruscate (Sexton) on Jul 30, 2003 at 21:22 UTC

    Or... skip the system call altogether and use some ascii escape codes :) Assuming you're using a terminal that supports it:

    perl -le 'print "\e[2J\e[H", `who` and sleep 2 while 1'


    If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, please reply to this node or /msg me to inform me as to what is wrong with the post, so that I may update the node to the best of my ability.

      Or... bring back clear to make it slightly more portable and save some keystrokes. :-)

      perl -e 'print `clear`,`who` and sleep 2 while 1'

      -sauoq
      "My two cents aren't worth a dime.";
      

        <silly childplay>

        OR... make it longer to support those poor win32 users (well, assuming they might have installed a program called 'who' lol):

        perl -le 'print $^O =~ /Win32/ ? `clear;who` : `cls;who` and sleep 2 w +hile 1'

        </silly childplay>


        If the above content is missing any vital points or you feel that any of the information is misleading, incorrect or irrelevant, please feel free to downvote the post. At the same time, please reply to this node or /msg me to inform me as to what is wrong with the post, so that I may update the node to the best of my ability.