Hey guys, after a lot o work thinking in threads, forks etc, to do a nice progress bar to a download script, i made using Term::ProgressBar with content_cb of lwp module. But now
i dont know how save these file to my HD, becouse i cant store using content_file at same time use content_cb...
A piece of code:
$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;
}
Well i know lwp have a progress bar, but i want use term:progress bar....
any help?
Thanks Guys.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.