in reply to How to delete non-empty directory

Have a look at File::Path. It has a rmtree() function.

It works, the only downside is that if you want to catch any errors, you need to trap $SIG{__WARN__} - annoying, to say the least.