http://qs1969.pair.com?node_id=412429


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; }