Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: print a backspace in nph-"HTML"?

by Zed_Lopez (Chaplain)
on Dec 04, 2004 at 20:31 UTC ( [id://412429]=note: print w/replies, xml ) Need Help??


in reply to print a backspace in nph-"HTML"?

Now that brother VSarkiss called my attention to the intent of the code, it could be simplified like this:

for (0..3) { print "....\b\b\b\b"; sleep 1; }

or, for the uberterse version:

print "....\b\b\b\b" and sleep 1 for (0..3);

with brother BUU's caveat that if the print doesn't succeed, the sleep statement won't execute.

Updated: er, actually, that's wrong. There needs to be a sleep after each period.

for (0..3) { print "." and sleep 1 for (0..3); print "\b\b\b\b" and sleep 1; }

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (5)
As of 2024-03-28 22:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found