http://www.perlmonks.org?node_id=950856


in reply to How To Download DAT Files From Unsecured Website

I'm not sure that plucking code form the Internet (that you may or may not understand) and asking 'hey...how can you refactor this to do x and y?' is a brilliant strategy. Second, grabbing a whole bunch of files from somebody's website is probably a violation of their terms of service. Nevertheless, you might try something like this:

linux> perl -e 'for my $month (qw|June July|) {for(1..3){my $url = qq| +http://localhost/foo| . $_ . qq|\.tar&dt=| . qq|$month-2001|; print q +q|Doing >>> $url\n|; `wget $url` }}'
Replace the start of the URL with your target. Of course you'll need wget, but you can even download that for Windows nowadays. Please don't let this discourage you from learning Perl and trying to understand code that you find on the web. It just isn't a very good place to start if your intent is to learn this language. If your intent isn't to learn the language then you are in the wrong place. There are websites that will write scripts for you for a modest sum.

Celebrate Intellectual Diversity

Replies are listed 'Best First'.
Re^2: How To Download DAT Files From Unsecured Website
by Marjan (Initiate) on Feb 01, 2012 at 02:44 UTC

    Thank you for your help. The website makes the data available for downloading; as I'm a student I'm using it for research purposes.