I appreciate the lead. If you or someone else could give me a clue as to where to add this delay and how to make the callback, it would be much appreciated. I'm unfamiliar with the methods used by LWP::UserAgent, and when I tried using the special ':content_cb'     => \&callback mechanism, with "callback" being a subroutine that used usleep, all I got for my effort was a downloaded file named /content_cb ...hardly the expected behavior. I'm obviously clueless, even after reading the documentation. Given a hint as to how to start this, I'd like to see if anything useful could be done to rate-limit the connection. I spent a few hours playing with it already, but couldn't get past even the first step.

Update: I found a question asked some years ago on SO that posted a code snippet which invoked the ':content_cb' callback, and I tried it. It changes absolutely nothing except that the downloaded file is misnamed (becomes "/content_cb", instead of the .html file that it should be). No change whatsoever in speed, regardless of the number put into "usleep". Adding a print line resulted in nothing as well--no output to the screen, so I don't think the subroutine is actually running, and it seems LWP::UserAgent is conflating the ':content_cb' token for the ':content_file' one.

Blessings,

~Polyglot~


In reply to Re^2: Bandwidth limiting for file downloads: What can Perl do? by Polyglot
in thread Bandwidth limiting for file downloads: What can Perl do? by Polyglot

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • 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:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.