Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
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?
LanX 1 ..2 ..3 ..4 .. is erix missing ;-)
LanX is Discipulus reciting "Springtime for Hitler" ?
[choroba]: erix could tell you how to do it in Postgres
[LanX]: NOOOOOOOOOOOOOOO not again
[chacham]: wow, mysql really is as bad as i thougt
[choroba]: completion?
[LanX]: That's what he usually does when MySQL is mentioned ;-)
[chacham]: the same thing could be achieved with a trigger
[LanX]: choroba yes
chacham shudders at the thought of using a trigger...so evil

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (11)
As of 2017-03-30 15:10 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Should Pluto Get Its Planethood Back?



    Results (360 votes). Check out past polls.