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
In reply to Re: Unlink files but not in pwd
by grinder
in thread Unlink files but not in pwd
by athanasia
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |