in reply to Printing changing variable in perl

You can use \r to back up and print over a line:
use warnings; use strict; $|++; for (1 .. 3) { print "\r$_"; sleep 2; } print "\n";

Replies are listed 'Best First'.
Re^2: Printing changing variable in perl
by Discipulus (Canon) on Feb 27, 2014 at 09:26 UTC
    never, never, never suspected the existence of this! thanks Toolic
    For posterity, as pointed by ambrus you can find this in docs but i never understood what also wiki says: A carriage return, .. is .. a mechanism used to reset a device's position to the beginning of a line of text.

    L*
    There are no rules, there are no thumbs..
    Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.