zi663227 发表于 2015-12-28 14:35:14

获取历届软考题目的小程序(perl)

最近在准备软考-信息处理技术员。为了省钱就没有买资料,在:http://www.csairk.com/zt/ztda/看到了试题和参考答案,就写了个程序把它们下载下来了。不是很完美。另存为xxx.pl直接运行即可。Perl语言: 临时自用代码#!perl -w use strict; use 5.010; use LWP::Simple; use Encode; sub get3times{   my $url = $_;my $content;   foreach (1..3){         $content = encode("gb2312" ,get ($url));         if ($content && $content =~ m{</html>}i){             #say "downloading $url";             return $content;             #sleep 1;         }         else{            say "failing to download [...]
页: [1]
查看完整版本: 获取历届软考题目的小程序(perl)