Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Re: Re: Range of File Names and For/While Problem

by demerphq (Chancellor)
on Sep 22, 2003 at 21:57 UTC ( #293307=note: print w/ replies, xml ) Need Help??


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.



Comment on Re: Re: Re: Range of File Names and For/While Problem
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others avoiding work at the Monastery: (9)
As of 2015-07-02 05:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (29 votes), past polls