use File::Path; rmtree([ '/tmp/foo', '/tmp/bar' ]);