3 use Term::ProgressBar 2.00;
5 use constant MAX => 10_000_000;
7 my $max = int($ARGV[0]+0) || MAX;
8 my $progress = Term::ProgressBar->new({name => 'Powers', count => $max,
10 $progress->max_update_rate(1);
15 for(my $i = 0; 2**$i <= $_; $i++) {
18 $progress->message(sprintf "Found %8d to be 2 ** %2d", $_, $i);
22 $next_update = $progress->update($_)
25 $progress->update($max)
26 if $max >= $next_update;