Home > Archive > PERL Miscellaneous > February 2007 > Perl Script to download files (Need Help)
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Perl Script to download files (Need Help)
|
|
| NZJAV05@gmail.com 2007-02-26, 4:08 am |
| 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
| |
| Josef Moellers 2007-02-26, 4:08 am |
| NZJAV05@gmail.com 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=20
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=20
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=20
used to download files, e.g. wget or curl. Any specific reason why it=20
has to be Perl? Maybe the assignment specified Perl as the=20
implementation language?
--=20
Josef M=F6llers (Pinguinpfleger bei FSC)
If failure had no penalty success would not be a prize
-- T. Pratchett
| |
| Mirco Wahab 2007-02-26, 4:08 am |
| NZJAV05@gmail.com 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.
| |
| Jürgen Exner 2007-02-26, 7:05 pm |
| NZJAV05@gmail.com 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
| |
| john.swilting 2007-02-26, 7:05 pm |
| Josef Moellers wrote:
> NZJAV05@gmail.com wrote:
>
> 2min times several hundred people ...
>
>
> 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.
>
>
> Depends on the script.
>
>
> 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
| |
| Joe Smith 2007-02-26, 7:05 pm |
| NZJAV05@gmail.com 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
|
|
|
|
|