in reply to unlink and rmdir

perldoc -f rmdir says it deletes only if the directory is empty. To delete a non-empty directory, use:
use File::Path; rmtree($dir, 0, 1);
See perldoc File::Path for details.

Replies are listed 'Best First'.
Re: Re: unlink and rmdir
by Roger (Parson) on Nov 30, 2003 at 23:03 UTC
    Just another 'TAMTOWTDI'. I know this is non-portable, but on unix machines, I am most likely going to do something like this instead -
    system("/bin/rm -rf $dir");
    or simply
    `/bin/rm -rf $dir`;