laziness, impatience, and hubris | |
PerlMonks |
Re: progress barsby PetaMem (Priest) |
on Nov 04, 2001 at 13:21 UTC ( [id://123158]=note: print w/replies, xml ) | Need Help?? |
Hi,
yesterday I somewhat fixed a version of my "progress bar fillup" I
created after this thread. Most of the ideas came from tye.
Initializes the progress-bar. It defines how long the data to be munged are (showlen), what character should be used for progress visualization (char) and how long the progress bar shall be (barlen). All 3 are scalars. If you wish to init a progress bar with a [####### ] look&feel, that should show progress reading a file and be 40 chars wide, you could init it like that: Where $file is a name of an existing file. The calls doing the actual visualization are like that: You either give the closure the length of data you have munged or - if you omit the parameter - pb_fillup just does an increment. I´m sure, the code can be much optimized and beautified, but it´s pretty easy to use and does accomplish its task for me.
Bye Oh! The code:
In Section
Seekers of Perl Wisdom
|
|