in reply to Removing Directory and Contents with Perl

If you want to delete a directory tree (including the contents), use the rmtree function in File::Path.

In addition, you may be interested in File::Spec, which can be used to portably perform operations on path names.

Finally, if you want to stick with rmdir, you should also look at unlink.