Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This node falls below the community's threshold of quality. You may see it by logging in.

Replies are listed 'Best First'.
Re: Creating progress bar
by dorward (Curate) on Oct 27, 2005 at 14:27 UTC

    You misspelt Term::ProgressBar, so it would be a little tricky for the system to find it...

Re: Creating progress bar
by Sandy (Curate) on Oct 27, 2005 at 14:36 UTC
    Ok, so you don't want an hourglass, don't want gui (i.e. Tk), and now you are saying that you don't even want to download a module from CPAN? Why????

    Not too long ago, there was a thread in perlmonks where someone had a kind of twirling baton, and the 'how to do it' was explained well.

    I could try to find the node for you, but, honestly, I don't really feel like putting more time into your problem than you seem to want to put into solving your own problems.

    Try super-search.

    PS: For others reading this node, this is a continuation of Creating hourglass using PERL

Re: Creating progress bar
by sgifford (Prior) on Oct 27, 2005 at 19:02 UTC
    Have you installed Term::ProgressBar on your system, and told your program where it is with a use lib statement or similar?
Re: Creating progress bar
by zentara (Cardinal) on Oct 27, 2005 at 20:23 UTC
    This snippet has been floating around for awhile.
    #!/usr/bin/perl $|=1; do{ print progress_bar( $_, 100, 25, '=' ); sleep 1 } for 1..100; # print a progress bar, inputs should be self explanatory otherwise ju +st RTFS! sub progress_bar { my ( $got, $total, $width, $char ) = @_; $width ||= 25; $char ||= '='; $num_width = length $total; sprintf "|%-${width}s| Got %${num_width}s bytes of %s (%.2f%)\r", $char x (($width-1)*$got/$total). '>', $got, $total, 100*$got/$ +total; }

    I'm not really a human, but I play one on earth. flash japh