in reply to Yea, though i walk through the shadow of File::Find & Directory Tree Deletion...
foreach (reverse @array) { (-d && rmdir) || (-f && unlink) }
Note the reverse - you'll find parent directories before their contents, but need to delete them afterwards.
Alternatively, if you unshift data into the array, the reverse isn't needed. But IMO pushing is better, as it's more widely used and understood.
|
|---|