in reply to Re^3: Bandwidth limiting for file downloads: What can Perl do?
in thread Bandwidth limiting for file downloads: What can Perl do?

So why might that work with WWW::Mechanize and not with LWP::UserAgent which is supposed to accept the same callbacks? Is this a bug in the latter? With the Mechanize, it did reduce the bandwidth considerably, but at the end of 10+ minutes I had no file. How does one keep the file, too?

Blessings,

~Polyglot~

  • Comment on Re^4: Bandwidth limiting for file downloads: What can Perl do?

Replies are listed 'Best First'.
Re^5: Bandwidth limiting for file downloads: What can Perl do?
by Corion (Patriarch) on May 01, 2022 at 05:01 UTC

    The same code should work with LWP::UserAgent, because WWW::Mechanize inherits from it.

    If you want to keep the file, you write the data in the callback instead of just printing the length of the data you received.