in reply to File::Find managing the %options versus \&wanted dichotomy

what would you recommend?

File::Find::Rule

use strict; use warnings; use File::Find::Rule; use Time::Local; my ($min_time, $max_time) = ( timelocal(0,0,15,15,7,105), timelocal(0,0,18,16,7,105) ); my @directories = ( '/home/ftp/pub/', $ENV{ AC_SYSTEM }, $ENV{ AC_WORK +DIR } ); print File::Find::Rule->file->mtime(">$min_time")->mtime("<$max_time") ->in( @directories );

Replies are listed 'Best First'.
Re^2: File::Find managing the %options versus \&wanted dichotomy
by anonymized user 468275 (Curate) on Aug 17, 2005 at 12:03 UTC
    The rule idea is very neat, but not a core module and unfortunately cannot be used in the actual situation. Also this solution implements a subset of the rules managed by the code in the OP that already works, but it doesn't add anything, specifically it doesn't address the problem of avoiding protected directories, so unfortunately the particular example fails to justify using Find::File::Rule as an alternative.

    One world, one people

      The rule idea is very neat, but not a core module and unfortunately cannot be used in the actual situation

      Why not? It's pure perl so you can always just copy 'n' paste if you have to.

      Also this solution implements a subset of the rules managed by the code in the OP that already works, but it doesn't add anything, specifically it doesn't address the problem of avoiding protected directories, so unfortunately the particular example fails to justify using Find::File::Rule as an alternative.

      Did you try it? It does exactly what the code in the OP does, in addition to not producing any error messages. F::F::R is bright enough to not chdir into places it's not allowed.

        Even cutting and pasting is going to blow this up from being a simple solution to being more complex when compared with a hand-rolled solution using glob and a recursive subroutine.

        Update: From the downvotes this is getting , I suggest looking at this for proof before jumping to the conclusion that 'modules are always better' Re: File::Find managing the %options versus \&wanted dichotomy

        One world, one people