Serious advice.

Skip the flowchart. In it you have steps like, "initialize variables". But if you can you don't want to have a ton of variables that you want to initialize. If you must, you must, but you would prefer not to.

Instead go bottom up. Write a function that you know you will need. For instance given a server and a directory, look for images in it. You need that function. It is not hard to write. You can write it without needing any global variables.

When you get done you will have cleaner code that is better factored and easier to modify. For instance you have in your flowchart big grey steps like, "Choose a random directory." How? guess whether it has something like images? Hope it doesn't have an index.html file so you can get a directory listing? Start following random pages looking for links? My guess is that once you are done you will find that that logic needs fixing...


And yes, you did miss something. Something big. You are writing a robot. It is impolite in the extreme to write a robot that fails to look for robots.txt and respect what that file asks you to do. That will require significant changes to your overall logic. What changes? Don't worry about it just yet. Focus on how to use LWP first...


In reply to Re (tilly) 1: Random Image Grabber by tilly
in thread Random Image Grabber by bladx

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.