http://www.perlmonks.org?node_id=74967


in reply to easy newbie question

The only time you should use "\r" is when you specifically require a carrige return without a new line, like in this.

for (1..10) { print "\r$_"; sleep 1; }

That code counts from one to two once per second reusing the same line. This can be useful for a progress counter or other ticker you need to update.

In almost all other cases a "\n" is the normal way for new lines, except in network communication where you should generally use "\015\012" or something similar.