Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
#!/perl/bin/perl -w use strict; use warnings; use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); use File::Find; print header(); my $dir_rv = "c:/progra~1/apache~1/apache2/cgi-bin/"."del"; opendir DIR, $dir_rv or return; my @contents = map "$dir_rv/$_",sort grep !/^\.\.?$/,readdir DIR +; closedir DIR; foreach (@contents) { next unless !-l && -d; print "<br><font color=red>Found:^^$_^^</font><br>"; rmdir ( "$_" ) or die ("Could not remove $_"); print "<br><font color=red>Found:^^$_^^</font><br>"; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Deleting a Directory
by ropey (Hermit) on Nov 16, 2006 at 18:45 UTC | |
|
Re: Deleting a Directory
by chargrill (Parson) on Nov 16, 2006 at 18:52 UTC | |
by Anonymous Monk on Nov 16, 2006 at 19:06 UTC | |
|
Re: Deleting a Directory
by ahmad (Hermit) on Nov 16, 2006 at 19:24 UTC | |
|
Re: Deleting a Directory
by jdhedden (Deacon) on Nov 17, 2006 at 15:37 UTC | |
|
Re: Deleting a Directory
by davorg (Chancellor) on Nov 17, 2006 at 15:46 UTC |