use Tie::Cycle; tie my $spinner, 'Tie::Cycle', [map "\b$_",qw(> -> --> ---> ----> ---> --> -> >)]; print $spinner while (1);