I've got a script which is using some bash commands to suppliment my perl. I would like to turn the whole script into a perl script to make it a little more efficent, and to learn some more about perl. Here are the things that are going on in particular. I have the script take in a URL at the command line. Then I use wget to download the file at the end of the URL (a web page) and write it to a file, then I open the file and read through it with a while loop one line at a time. I went hunting around for a way for perl to download the webpage, but I haven't found anything. (My research abilities aren't that great with perl, I mostly just try google searches. I don't really know how CPAN works, and I know there is some manual that can be searched, but I don't know what it is called or how to search it. If anyone has pointers on that, I would be most greatful for the information). If I can get the webpage downloaded with perl, then I expect I could just avoid writing to a file, and then would be able to have an array read the whole thing in (If I recall from a previous script I made the array will default to breaking the elements into every new line.) So basically I'm wondering how to replace wget with a perl solution (I have a bunch of other questions, but I would rather beat on them myself for at least awhile, as I will learn more that way.) Thanks, Michael

In reply to From bash to perl by paranoid times

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.