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