Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

hey monks-- I have a java program that compares files of the same name with different extensions (ie pdf, html). If the html is 'older' than the corresponding pdf I would like to print those html files (perhaps in their own array). I would like to do this in perl. I am just learning, great fun! Is there a way that can traverse a directory (and sub-directories) to do this? Thanks for your help!

Replies are listed 'Best First'.
Re: scan for files/dates
by particle (Vicar) on Jan 28, 2002 at 01:41 UTC
    this is easily doable in perl. you can start by looking at the File::Find and Date::Calc modules. there's plenty of info here at the monastary on their application to specific problems. start your quest by using Super Search.

    if you're unfamiliar with using modules, there's plenty of info here on that as well. and if you run into problems with your code, post it and we'll gladly have a look.

    ~Particle

Re: scan for files/dates
by screamingeagle (Curate) on Jan 28, 2002 at 04:40 UTC
    to perform recursive directory operations, you can also use File::Recurse
Re: scan for files/dates
by blakem (Monsignor) on Jan 28, 2002 at 03:43 UTC