Beefy Boxes and Bandwidth Generously Provided by pair Networks
Pathologically Eclectic Rubbish Lister
 
PerlMonks  

Re: overwritting print in same line

by ansh batra (Friar)
on Nov 14, 2011 at 06:48 UTC ( [id://937874]=note: print w/replies, xml ) Need Help??


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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://937874]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (6)
As of 2024-04-19 07:14 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found