in reply to overwritting print in same line

i know its not the correct solution
just came to my mind so wanted to share
while (1) { for (1..20) {print "."; system ("sleep 0.05"); } #print "\n"; system("clear"); }

Replies are listed 'Best First'.
Re^2: overwritting print in same line
by sagar123 (Novice) on Nov 14, 2011 at 07:45 UTC

    hi ansh, quester and anonymous thanks for the replies

    ansh: u suggested is tricky but it actually clear off the screen that what dont want to do that. As u can see spinner suggested by quester is quite good in the sense it doesnot clear off the screen. So if u just replace \b with \n it will print in separate lines. But with \b it is printing on same line.

    quester: this is what I wanted. But ethically i cant use ur code so I need to solve my problem. for example in ur code u replace \b with \n it print in separate line. This is what happening with my dots. But if u keep \b in ur code it prints -\/ in same line and "overwriting" it at same place.I dont understand ur code well. ALSO please can u explain ur code explicitly as exactly whats happening. I am somewhat slow :-(

    Thanks to anonymous also