CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
Search Posts SEARCH
Who's Online WHO'S
Log in LOG

Home: Perl Programming Help: Advanced:
file downloading using perl



Jul 21, 2011, 5:28 AM

Post #1 of 2 (3146 views)
file downloading using perl Can't Post

Im trying to write a perl code to do the following task.

I have a website which is located in a diffirent country.
I want to download a file from that site everyday.
The file name keeps on changing everyday.
say the file name is CTP-latest-
next day it may change to "CTP-latest-" or remain same.

I want to download only if the version number (ie. 38 in above example("38.iso") is not the same from last sucessful download or else dont download.

Im very poor in perl, can someone help me on this ?

i tried with


use LWP::Simple;

#-- fetch the zip and save it as
my $status = getstore("http://star.mywebsite/CTP-LATEST-", "CVP-LATEST-");

if ( is_success($status) )
print "file downloaded correctly\n";
print "error downloading file: $status\n";

This works fine in downloading the file, But I need to have a check on version number. So I want to download only if the version number has been changed from the version number of previous successful download.

thank you for your time.


Jul 22, 2011, 9:39 PM

Post #2 of 2 (3056 views)
Re: [srijithbhandary] file downloading using perl [In reply to] Can't Post

1) Use LWP to download the webpage that actually links to the file.
2) Parse that file to determine the current resource version
3) Download that file if it's different from the previously downloaded resource.

- Miller


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives