#如何调用
deleteFolder("test");
#Used to remove a directory which is not empty.
#the process function.
sub deleteFolder{
my $path = $_[0];
chdir $path;
#get all the files in that directory.
@_=<*>;
for(@_){
if(-d $_){
#if the destination file is a directory, go recursion.
deleteFolder($_);
}else{
unlink;
}
}
#Go up and del the destination directory.
chdir "../";
rmdir $path;
}

