papaismurf has asked for the wisdom of the Perl Monks concerning the following question:
A piece of code:
Well i know lwp have a progress bar, but i want use term:progress bar.... any help? Thanks Guys.$progress = Term::ProgressBar->new({count => $total_size, ETA => 'l +inear'}); $progress->max_update_rate(1); my $response = $ua->get($url, ':content_cb' => \&callback, ); $progress->update($total_size); sub callback { my ($data, $response, $protocol) = @_; $final_data .= $data; $next_update = $progress->update(length($final_data))if length($fin +al_data) >= $next_update; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: LWP - content_cb
by Eliya (Vicar) on Feb 15, 2012 at 01:13 UTC | |
by papaismurf (Novice) on Feb 15, 2012 at 03:51 UTC | |
by Eliya (Vicar) on Feb 15, 2012 at 04:11 UTC | |
by papaismurf (Novice) on Feb 15, 2012 at 05:02 UTC | |
by zentara (Cardinal) on Feb 15, 2012 at 09:38 UTC | |
| |
|
Re: LWP - content_cb
by Anonymous Monk on Feb 15, 2012 at 19:16 UTC |