in reply to Command line output of Perl script

Thanks for all the responses. I found them all useful. I never realised how \r works. I always thought it goes to the next line like \n. Turns out that's all I needed. However, I checked out some of the progressbars on CPAN as well as well the Doom style progress bar. Very useful.

Thanks again for the help.
  • Comment on Solution: Command line output of Perl script

Replies are listed 'Best First'.
Re: Solution: Command line output of Perl script
by ikegami (Patriarch) on Sep 09, 2005 at 16:15 UTC

    In DOS, Windows and printers, CR ("\r") means move the cursor to the begining of the line. LF means move the cursor to the same column on the next line. (Remember that "\n" gets translated to LF when in binmode, and to CRLF when not.)

    In unix, CR ("\r") means move the cursor to the begining of the line. LF ("\n") means move the cursor to the begining of the next line.