【黄子按曰:】前些年Google被墙后,用了一段时间的EverNote,先是国际版,后是中国版。今天偶然重新进入国际版账户,发现还有一些旧笔记,《Perl生物信息学编程》课程还能用得上,现在以博文形式分享在这里。【:黄子按曰】
使用“草莓萢儿”的cpan安装新模块,shell一直反馈:
Indexing failed! at D:/Strawberry/perl/vendor/lib/CPAN/SQLite.pm line 70, line 8.
......
Google一下,stackoverflow上一位遭遇与我类似。网友众说纷纭。其中,brian d foy的说法如下:
You don't need to reinstall Strawberry anytime you have a problem. I know this is Windows, but life is better than that. Try deleting C:strawberrycpansourcesmodules 2packages.details.txt.gz, which appears to be corrupted. CPAN.pm should re-download it if it is missing.
answered Feb 21 at 16:04 brian d foy
可惜这一回答未得到发帖者认可,发帖者始终认为是网络及权限问题。
I did that as well. This is a fresh install to begin with, so I did try a full reinstall as well as deleting the corrupted file. The issue is with the network connection, at least without SQLite. The network firewall is burning the request as an unauthorized user, even with admin rights. – steventnorris
但是,我知道brian d foy乃萢儿大牛,所言必有其道理,不可轻信发帖者的意见。于是按图索骥,发现我的目录中02packages.details.txt.gz只有1k大小,于是删去。再次进入cpan的shell, 然后install所需模块,shell反馈:
Fetching with LWP:
http://cpan.strawberryperl.com/modules/02packages.details.txt.gz
Creating database file ...
Indexing failed! at D:/Strawberry/perl/vendor/lib/CPAN/SQLite.pm line 70, line 8.
......
咦,难道发帖者是对的?仔细一看,02packages.details.txt.gz已经变成1388K大小了,但modules目录下还有一个03modlist.data.gz也还只有1K,于是删除该文件后再次进入cpan的shell并install所需模块,shell反馈:
Fetching with LWP:
http://cpan.strawberryperl.com/modules/03modlist.data.gz
Creating database file ...
Indexing failed! at D:/Strawberry/perl/vendor/lib/CPAN/SQLite.pm line 70, line 8.
CPAN::SQLite setup failed at D:/Strawberry/perl/vendor/lib/CPAN/SQLite/META.pm line 339, <DATA> line 8.
......
再看,03modlist.data.gz已211K大小了,但奇了怪了,问题仍未解决。举一反三,在sources文件夹下,除了modules文件夹外,还有一个authors文件夹,内有01mailrc.txt.gz文件,也只有1k,删除该文件后再次进入cpan的shell并install所需模块,shell反馈:
Fetching with LWP:
http://cpan.strawberryperl.com/authors/01mailrc.txt.gz
Creating database file ...
Done!Running install for module ......
成功下载所需模块,自动解决模块依赖性问题,测试、安装,一切OK。大牛所言虽然不全,但本菜鸟受益匪浅。