Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: search folder and delete certain files with perl

by jwkrahn (Monsignor)
on Dec 07, 2011 at 22:23 UTC ( #942338=note: print w/ replies, xml ) Need Help??


in reply to search folder and delete certain files with perl

#!/usr/bin/perl use warnings; use strict; for my $file ( </var/opt/xim/syslogs/Syslogd*> ) { if ( -M $file > .5 ) { unlink $file or warn "Cannot delete '$file' because: $!"; } }


Comment on Re: search folder and delete certain files with perl
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others browsing the Monastery: (8)
As of 2014-08-30 19:15 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (293 votes), past polls