可用如下的PERL程序进行目录的浏览
执行如:
perl getdir.py D:\\设计模式Delphi版
#getdir.py
sub listfile{
my $dir = shift @_;
opendir DH, $dir;
foreach my $file (readdir DH){
next if $file eq "." or $file eq "..";
$file = "$dir/$file";
if(-d $file){
&listfile($file);
}
else{
print $file . "\n";
}
}
return 1;
}
if(@ARGV!=1){
print STDERR " program information \n";
print STDERR " program usage \n";
exit;
}
while(@ARGV){
$dir = shift;
&listfile($dir);
}