Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw

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


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?

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

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (5)
As of 2016-05-30 00:15 GMT
Find Nodes?
    Voting Booth?