]> git.donarmstrong.com Git - term-progressbar.git/blob - eg/smooth_bar.pl
copy two examples from the docs to the eg directory
[term-progressbar.git] / eg / smooth_bar.pl
1 #!/usr/bin/perl\r
2 use strict;\r
3 use warnings;\r
4 \r
5 use Term::ProgressBar 2.00;\r
6 \r
7 my $max = shift || 100;\r
8 \r
9 my $progress = Term::ProgressBar->new($max);\r
10 \r
11 for (0..$max) {\r
12   my $is_power = 0;\r
13   for(my $i = 0; 2**$i <= $_; $i++) {\r
14     $is_power = 1\r
15       if 2**$i == $_;\r
16   }\r
17 \r
18   $progress->update($_)\r
19 }\r