use Tie::Cycle; tie my $whirley, 'Tie::Cycle', [ qw( | / - \ ) ]; # And now for the demonstration ... ++$|; while (1) { print $whirley, "\b"; sleep 1; }