#!/usr/bin/perl -w use strict; $| = 1; my @spinner = ('|', '/', '-', '\\'); my $bigscale = 100_000; my $scale = 100; my $index = 0; # replace the following two lines # with a loop appropriate to the project my $in_loop = 1; while ($in_loop) { # Do work. print $spinner[($index++ / $scale) % 4], "\b"; print '.' unless ($index % $bigscale); # And for completeness, for demonstration purposes... $in_loop = 0 if ($index > (($scale / 2) * $bigscale)); }