8/27/2009

Perl display the progress indicator

In most cases in perl progress indicator, most people uses print statement without carry over or '\n' to show where you are. The problem with this s that unless that buffer is set to unbuffer, it will waitin until carry over before it is displayed on the terminal. So, unless it's done, you are not going to see the progress...

Simple solution to this is to set unbuffer as setting $| to 1. All done, simple.
$| = 1;

Now it will display as it progresses.