2005-04-12

Perl - delete empty directories

The Program

use File::Find;
finddepth(sub{rmdir},'.')

But wait, there's more!

To save the time of copying that to a file before running it, use Perl's lazy feature whereby one can run a whole program from a string. Simply, on the command prompt, type

perl -MFile::Find -e"finddepth(sub{rmdir},'.')"



Cool, huh?!