Oh, i had no doubt that it worked. I had trouble understanding *how* it worked. I write my perl in a very declarative and verbose manner, have never had reason to use map before, didn't know you could string commands together with commas to act on $_ without wrapping it in braces and didn't know why you were pushing undefs into the array.

In short: The syntax and lack of any explanation completely stumped me.

Either way, i have to admit that it is a superior solution to the wget method, as long as enough ram is available. Getting it to run enough threads to run at comparable speed to the wget method required 300 mb. However, due to the fact that it actually is possible to keep control of the ram use and that it runs entirely with Perl modules it is the better solution.

As such, thanks a lot. :)

FWIF, this is how i'm using it now:
sub fetch_xml_data { my ($ids) = @_; my $dir = 'quicklook/'; my $url = 'http://api.eve-central.com/api/quicklook?typeid='; my $thread_count = 20; my $Q = new Thread::Queue; my @threads; for my $id (@{ $ids }) { $Q->enqueue( $id ); } for ( 1 .. $thread_count ) { push @threads, threads->create( sub { require LWP::Simple; while( my $id = $Q->dequeue ) { say "Downloading XML file for id $id.<br>"; LWP::Simple::getstore( $url.$id, $dir.$id ); } } ); $Q->enqueue( undef ); } $_->join for @threads; }
</readmore

In reply to Re^4: Parallel downloading under Win32? by Xenofur
in thread Parallel downloading under Win32? by Xenofur

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.