in reply to How do I delete a directory without emptying it first?

The simplest cross-platform method I have found was with the File::Path function rmtree. You pass it an array of directories you want to delete. It will delete the entire tree.
use File::Path; rmtree([ '/tmp/foo', '/tmp/bar' ]);