5 use Term::ProgressBar 2.00;
7 use constant MAX => 1_000_000;
9 my $max = int($ARGV[0] || MAX);
10 my $progress = Term::ProgressBar->new({
20 for(my $i = 0; 2**$i <= $_; $i++) {
27 $next_update = $progress->update($_)
30 $progress->update($max)
31 if $max >= $next_update;