title: How can I sync two directories with Perl?
body: <p>I have a folder called "Lib" in my drive it contains many files inside and I have a problem that this "Lib" folder is there in many other places in the drive. My Perl script has to copy the contents from folder "Lib" which are latest updated and paste it in the folder "d:\perl\Latest_copy_of_Lib" </p>
  
  <p>For example,  I have a Lib folders in <code>d:\functions</code>, <code>d:\abc</code>, and many other places.  I want to find the latest copy of each file in those directories.  So, if the file <code>d:\functions\foo.txt</code> was last modified on 2009-10-12 and <code>d:\abc\foo.txt</code> was last modified on 2009-10-13, then I want the version in <code>d:\abc</code> to by copied to the target directory.</p>
  
  <p>I have used file::find but it searches in whole dir and copies the contents that are not latest copy.</p>