- 论坛徽章:
- 0
|
在一篇批量反编译chm文档的脚本的精华文章里,看到一句 判断空格的这句话是什么意思啊,if(m@[*?\[\]]@)
#!/usr/bin/perl
#Decompile .chm file to html format.
#Author Huang Yong.
#2007-9-10
#Usage:progname filename1 filename2 ...
#可使用通配符
use File::Copy;
use File::Basename;
sub decompiler
{
my $chmfile = $_[0];
my $tmp = "temp";
my $i=1;
while (-e "$tmp.chm" or -d $tmp){
$tmp = $tmp.$i;
$i++;
}
die "Cannot open file $chmfile" unless (-e $chmfile);
copy($chmfile,"$tmp.chm") or die "Copy failed: $!";
mkdir ("$tmp") or die "Cannot create temp!";
`hh.exe -decompile $tmp $tmp.chm`;
my $html_dir = basename($chmfile);
$html_dir =~ s/\.chm$//;
move("$tmp",$html_dir);
unlink ("$tmp.chm");
}
for(@ARGV){
my @chmfile;
if(m@[*?\[\]]@){
@chmfile =glob($_);
}
else{
push(@chmfile,$_);
}
for $file(@chmfile){
print "正在反编译 $file,请稍候...\n";
decompiler($file);
print "文件$file编译完成。\n"
}
} |
|
|