Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Keeping a local copy of a file up-to-date

by BrowserUk (Pope)
on Sep 04, 2011 at 21:22 UTC ( #924124=note: print w/ replies, xml ) Need Help??


in reply to Keeping a local copy of a file up-to-date

The lwp-mirror command that comes with perl is for exactly this task.

lwp-mirror [-v] [-t timeout] <url> <local file>

Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.


Comment on Re: Keeping a local copy of a file up-to-date
Download Code
Re^2: Keeping a local copy of a file up-to-date
by Jim (Curate) on Sep 04, 2011 at 22:51 UTC

    bontchev plainly asked:

    My Perl script uses a local file as a database for some task. The master copy of this file is available on the Web. I would like to make sure that my local copy is up-to-date - i.e., matches the master copy. Is there a CPAN module for that sort of task - or do I have to re-invent the wheel?

    How is information about a command-line utility relevant to Dr. Bontchev's inquiry about a CPAN module for use in his Perl script?

      Because if you look inside that script, ignoring the command line options and help stuff, the whole script consists of two lines:

      use LWP::Simple qw( mirror ); $rc = mirror( $url, $file );

      'nuff said?


      Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
      "Science is about questioning the status quo. Questioning authority".
      In the absence of evidence, opinion is indistinguishable from prejudice.

        But how is this responsive to Vesselin's question?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://924124]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2014-07-29 21:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (228 votes), past polls