Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^4: list files based on age and pattern

by kaka_2 (Sexton)
on Sep 16, 2013 at 13:56 UTC ( #1054299=note: print w/replies, xml ) Need Help??


in reply to Re^3: list files based on age and pattern
in thread list files based on age and pattern

Hello hdb,

Sorry it is mistake while copy paste but in the actual script closdir is after the readdir.

there is no syntax or compilation error, only no files.

-KAKA-

  • Comment on Re^4: list files based on age and pattern

Replies are listed 'Best First'.
Re^5: list files based on age and pattern
by hdb (Prior) on Sep 16, 2013 at 14:28 UTC

    My fault. You need to add the path to the filename when testing with -M like this

    my @files = grep {!/\_NSA|d+_\d+\.xml/ && (-M "$path/$_") > $min_age} readdir DIR;

    I only tested in the current directory where it does not make any difference.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1054299]
help
Chatterbox?
[marto]: it makes things less stressful for the parents that's for sure :P
[Corion]: Yeah (although their mother was somewhat stressed out regardless) - but it made for an otherwise relaxed evening ;)

How do I use this? | Other CB clients
Other Users?
Others having an uproarious good time at the Monastery: (5)
As of 2016-12-08 09:58 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (139 votes). Check out past polls.