Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl Monk, Perl Meditation
 
PerlMonks  

Re: Recursive search and delete

by Tommy (Chaplain)
on Nov 16, 2012 at 10:06 UTC ( #1004165=note: print w/ replies, xml ) Need Help??


in reply to Recursive search and delete

Untested:

use File::Util; unlink for grep { $_ =~ /xml$/i } File::Util->new->list_dir('/your/directory', '--recurse');

Or alternately:

use File::Util; $f = File::Util->new(); unlink for grep { $_ =~ /xml$/i } $f->list_dir('/your/directory', '--r +ecurse');
--
Tommy
$ perl -MMIME::Base64 -e 'print decode_base64 "YWNlQHRvbW15YnV0bGVyLm1lCg=="'


Comment on Re: Recursive search and delete
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2014-12-26 23:49 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (176 votes), past polls