Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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=="'

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 perusing the Monastery: (6)
As of 2016-08-30 09:09 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    The best thing I ever won in a lottery was:















    Results (414 votes). Check out past polls.