use warnings; use strict; my $spin; while (1) { print substr( "-/|\\", $spin++ % 4, 1 ), "\b"; $| = 1; select undef, undef, undef, 0.05; }