Perl Script to download files (Need Help)

Discussion in 'Perl Misc' started by NZJAV05@gmail.com, Feb 26, 2007.

  1. Guest

    Hi, I am completely new to using perl and I was wondering if I could
    take just 2 min of you time to help me here...

    I haven't used a perl script before, but I was wanting to know if
    there is a script out there that can download files from a url ? and
    if so, where can I download it... ?

    Last question, how do I initiate the script ?


    Sorry about the noob questions, but yeh, I am stumped....



    Cheers,


    Adam
     
    , Feb 26, 2007
    #1
    1. Advertising

  2. wrote:
    > Hi, I am completely new to using perl and I was wondering if I could
    > take just 2 min of you time to help me here...


    2min times several hundred people ...

    > I haven't used a perl script before, but I was wanting to know if
    > there is a script out there that can download files from a url ? and
    > if so, where can I download it... ?


    There are numerous scripts that can do that.
    Why not write it yourself? It's not _that_ complicated, e.g. using
    LWP::Simple, and you'll learn a lot trying. If you have problems getting
    it to run, post your attempts here and we'll help getting you on-track
    again.

    > Last question, how do I initiate the script ?


    Depends on the script.

    > Sorry about the noob questions, but yeh, I am stumped....


    BTW There are a couple of stand-alone (non-Perl) programs that can be
    used to download files, e.g. wget or curl. Any specific reason why it
    has to be Perl? Maybe the assignment specified Perl as the
    implementation language?

    --
    Josef Möllers (Pinguinpfleger bei FSC)
    If failure had no penalty success would not be a prize
    -- T. Pratchett
     
    Josef Moellers, Feb 26, 2007
    #2
    1. Advertising

  3. Mirco Wahab Guest

    wrote:
    > Hi, I am completely new to using perl and I was wondering if I could
    > take just 2 min of you time to help me here...
    >
    > I haven't used a perl script before, but I was wanting to know if
    > there is a script out there that can download files from a url ? and
    > if so, where can I download it... ?
    >
    > Last question, how do I initiate the script ?


    Thats not really a Perl question, a simple
    invocation of 'wget' (Unix/Linux/Windows)
    will help a lot:

    $> wget --referer="http : //www.moqawama.org/" \
    -U "IE/6" \
    https : //www.cia.gov/careers/jobs/operations_off_special.html


    The above will download said page (after removing spaces).


    Regards

    M.
     
    Mirco Wahab, Feb 26, 2007
    #3
  4. wrote:
    > I haven't used a perl script before, but I was wanting to know if
    > there is a script out there that can download files from a url ? and
    > if so, where can I download it... ?


    Your Question is Asked Frequently.
    perldoc -q HTML:
    "How do I fetch an HTML file?"

    > Last question, how do I initiate the script ?


    You execute it? Just like any other program or script written in any other
    programming language.

    jue
     
    Jürgen Exner, Feb 26, 2007
    #4
  5. Josef Moellers wrote:

    > wrote:
    >> Hi, I am completely new to using perl and I was wondering if I could
    >> take just 2 min of you time to help me here...

    >
    > 2min times several hundred people ...
    >
    >> I haven't used a perl script before, but I was wanting to know if
    >> there is a script out there that can download files from a url ? and
    >> if so, where can I download it... ?

    >
    > There are numerous scripts that can do that.
    > Why not write it yourself? It's not _that_ complicated, e.g. using
    > LWP::Simple, and you'll learn a lot trying. If you have problems getting
    > it to run, post your attempts here and we'll help getting you on-track
    > again.
    >
    >> Last question, how do I initiate the script ?

    >
    > Depends on the script.
    >
    >> Sorry about the noob questions, but yeh, I am stumped....

    >
    > BTW There are a couple of stand-alone (non-Perl) programs that can be
    > used to download files, e.g. wget or curl. Any specific reason why it
    > has to be Perl? Maybe the assignment specified Perl as the
    > implementation language?
    >

    lwp-get
    libnet
     
    john.swilting, Feb 26, 2007
    #5
  6. Joe Smith Guest

    wrote:

    > I haven't used a perl script before, but I was wanting to know if
    > there is a script out there that can download files from a url ? and
    > if so, where can I download it... ?


    Yes, several come with the perl installation.

    > Last question, how do I initiate the script ?


    Linux install: Perl is part of most distributions; installed already.
    Linux command: bash% GET 'http://www.example.com/x/foo.cgi?bar=yes'

    Windows install: http://www.activestate.com or http://www.cygwin.com
    MS-DOS command window: C:\> GET "http://www.example.com/x/foo.cgi?bar=yes"
    cygwin command: same as Linux

    -Joe
     
    Joe Smith, Feb 26, 2007
    #6
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Wet Basement
    Replies:
    1
    Views:
    2,590
    BobMonk
    Jul 15, 2003
  2. dpackwood
    Replies:
    3
    Views:
    1,862
  3. Replies:
    0
    Views:
    307
  4. heli0s

    Download Files With a perl script

    heli0s, Aug 4, 2005, in forum: Perl Misc
    Replies:
    8
    Views:
    134
  5. Replies:
    13
    Views:
    299
    Tad McClellan
    Feb 17, 2007
Loading...

Share This Page