use IO::Handle; STDOUT->autoflush(1); for (1..3) { print("\r$_"); sleep(1); } print("\n");