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?!

1 comment:

  1. Anonymous5:43 am

    Bush goes ballistic about other countries being evil and dangerous, because they have weapons of mass destruction. But, he insists on building up even a more deadly supply of nuclear arms right here in the US. What do you think? How does that work in a democracy again? How does being more threatening make us more likeable?Isn't the country with
    the most weapons the biggest threat to the rest of the world? When one country is the biggest threat to the rest of the world, isn't that likely to be the most hated country?
    Are we safer today than we were before?
    We have lost friends and influenced no one. No wonder most of the world thinks we suck. Thanks to what george bush has done to our country during the past three years, we do!

    ReplyDelete