$|++; for (my $x = 0; $x <= 25; ++$x){ foreach (("-", "\\", "|", "/")){ print $_; sleep 1; print "\b"; } }