3 use Term::ProgressBar 2.00;
5 use constant MAX => 100_000;
7 my $max = int($ARGV[0]+0) || MAX;
8 my $progress = Term::ProgressBar->new({name => 'Powers', count => $max, remove => 3});
14 for(my $i = 0; 2**$i <= $_; $i++) {
19 $next_update = $progress->update($_)
22 $progress->update($max)
23 if $max >= $next_update;