The specific error message you're getting is because you don't actually declare $line. You could do what with foreach my $line ( @lines ) {....

At some point you'll probably want to set up a parallel user agent. It's likely that your biggest bottleneck will be in fetching the documents, otherwise.

If you ask a dozen individuals how to implement a parallel user agent you'll probably get a dozen different answers. Some will include explicit use of fork or threads, while others might recommend a module that works well for them. I've used both LWP::Parallel::UserAgent, and Mojolicious's built-in Mojo::UserAgent. I think a lot more ongoing work and maintenance has gone into the latter, and since I use Mojolicious for other purposes anyway (and as it can be installed in under a minute), I lean toward the Mojo::UserAgent approach nowadays. Mojo::UserAgent combined with Mojo::IOLoop (an event loop) and Mojo::DOM (HTML/XHTML DOM parser with CSS selector support) is a powerful ally.


Dave


In reply to Re: Foreach Array and Html table extract by davido
in thread Foreach Array and Html table extract by doctordoctor

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.