in reply to unlink with regex?
I'd rather not open the dir and retrieve all the contents and iterate over each one.
Do you mean you don't want this to happen, or do you mean you don't want to code it yourself?
If the former, you're out of luck. That's the only way to get a directory listing.
If the latter, what you want is called globbing. Be sure to use File::Glob's bsd_glob rather than the builtin glob. While both are implemented by the same function, their handling of spaces differs. bsd_glob will handle them better.
You can also do nice things with File::Find::Rule name filter if you want a recursive solution.
|
|---|