$| = 1; # autoflush required while (<$fh>) { spinner if !($. % 100); # process line }
{ my @spin = qw(- \\ | /); my $time = time; sub spinner { if ($time != time) { ++$time; my $spin = shift @spin; print STDOUT "\r$spin"; push @spin, $spin; } } }
In reply to spinner to keep the patiently waiting user patient by ysth
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |