Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Unlink files but not in pwd

by grinder (Bishop)
on Mar 27, 2009 at 20:38 UTC ( #753770=note: print w/ replies, xml ) Need Help??


in reply to Unlink files but not in pwd

With recent versions of File::Path you can do the following:

use File::Path 'remove_path'; remove_path("/path/of/dir", {keep_root => 1});

This will remove everything in the directory, but not delete /path/of/dir itself.

update: oh, you want to unlink according to a pattern; I missed that on the first pass.

• another intruder with the mooring in the heart of the Perl


Comment on Re: Unlink files but not in pwd
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others wandering the Monastery: (5)
As of 2015-07-28 01:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (251 votes), past polls