I don't understand what you are trying to say in the first two paragraphs. (Yes, the debug statements would have worked with $| = 1. Yes, it would have worked by replacing $pics_found with @found_images. Just like I said in my post.)

If your point is that you're taking exception to me cleaning up the code, keep in mind that good code is readable and maintainable code. The excess of redundancy and the poor choice of variable names in the original code affected both readability and maintainability.

would it not be better for the server in terms of CPU and memory if the images were downloaded into a temp directory and sized locally rather than read from memory?

The CPU usage would be (slightly) higher, since we'd have extra code to write to the disk and read from the disk.

Yes, the memory usage could be smaller (depending on how we write to and read from the disk) by something less than the size of one image.

And of course, it would be slower because we'd have to do all the work we currenlty do, plus more.


In reply to Re^3: endless loop problems by ikegami
in thread endless loop problems by Anonymous Monk

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.