http://www.perlmonks.org?node_id=293307


in reply to Re: Re: Range of File Names and For/While Problem
in thread Range of File Names and For/While Problem

Dont forget File::Find is recursive. So youll grab all the files that match in sub directories as well, and should it contain a directory thats new enough you'll have a problem as it'll get included as well. Also as you are simply pushing the base name into the list you wont even know whats happening until you start to diagnose missing files and find them two layers deeper in the file structure :-)

use File::Find; my @files; my $age_limit=7; find { wanted=>sub { -f and -M($_) < $age_limit and push @files, $_ }, no_chdir=>1 }, 'd:\log\exported'; print join("\n",@files),"\n";

You should take a look at find2perl


---
demerphq

Everybody remember the Gandhi quote?

    First they ignore you, then they laugh at you, then they fight you, then you win.

Gentlemen and ladies, this newest leaked memo from Microsoft confirms that we are advancing through GandhiCon Three.