5 use Term::ProgressBar 2.00;
7 use constant MAX => 10_000_000;
9 my $max = int($ARGV[0]+0) || MAX;
10 my $progress = Term::ProgressBar->new({
15 $progress->max_update_rate(1);
20 for(my $i = 0; 2**$i <= $_; $i++) {
23 $progress->message(sprintf "Found %8d to be 2 ** %2d", $_, $i);
27 $next_update = $progress->update($_)
30 $progress->update($max)
31 if $max >= $next_update;