4. I was left with a lot of empty directories. I ran find with rmdir a couple of times do get rid of them.A "couple of times"??
A pure perl solution is to use File::Find and use finddepth instead of find. That way it'll kill the deepest lieing empty directories first.
Oh, and rmdir will not delete a directory if it's not empty.
So you can easily recursively delete empty directories in Perl using:
which can probably easily be converted to a one-liner — and shortened if you don't like the verbosity:use File::Find qw(finddepth); finddepth sub { -d and rmdir $_ and printf STDERR "rmdir: %s\n", $File +::Find::name }, @dirs;
I haven't tried running rmdir on a plain file. Probably it's safe.finddepth sub { -d and rmdir $_ }, @dirs;
In reply to Re^2: cleaning up old libs and @INC
by bart
in thread cleaning up old libs and @INC
by danmcb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |