获取历届软考题目的小程序(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 = $_[0];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 [...]
posted on 2011-03-15 20:36  justqb  阅读(161)  评论(0)    收藏  举报