in reply to Remove eMpTy Directories

Waaaaayy too much coding.
use File::Find; finddepth sub { return if $_ eq "." or $_ eq ".."; return unless -d; rmdir($_) or $! =~ /not empty/ or warn "Cannot rmdir $File::Find::na +me: $!"; }, @ARGV;

-- Randal L. Schwartz, Perl hacker
Be sure to read my standard disclaimer if this is a reply.

Replies are listed 'Best First'.
Re: •Re: Remove eMpTy Directories
by jdporter (Paladin) on Nov 19, 2002 at 16:17 UTC
      Quite inefficient. perl -MFile::Find -e 'find( { wanted => sub {}, postprocess => sub { rmdir $File::Find::name } }, @ARGV )'

      Makeshifts last the longest.