2012-06-13 10 views
0

我有一個代碼的Perl不能找到領帶/文件/ AsHash.pm

use Tie::File::AsHash; 
tie %sets, 'Tie::File::AsHash', '.\\main\\old_names.txt', split => '\+' or die "Problem trying to %hash: $!"; 

,我得到的錯誤:

Can't locate Tie/File/AsHash.pm in @INC <@INC contains: C:/strawberry/perl/site/lib C:/strawberry/perl/vendor/lib C:/strawberry/perl/lib .> at C:\Users\user\Desktop\test.pl line 97 (which is the second line I posted) 

BEGIN failed--compilation aborted at line 97. 
+1

從[堆棧溢出的Perl FAQ](http://stackoverflow.com/questions/tagged/perl?sort=faq):什麼是最簡單的方法來安裝缺少Perl模塊?](http://stackoverflow.com/questions/65865/whats-the-easiest-way-to-install-a-missing-perl-module) – daxim

+0

當你是一個語言的新手,很難知道條款來搜索他們親愛的批評者 – Grigor

回答

2

這通常表明該模塊沒有安裝。人們通常會安裝一個模塊如下:

cpan Tie::File::AsHash 
+1

我將如何安裝模塊? – Grigor

+0

@Grigor,已經添加到回答:) – ikegami

+0

這工作謝謝!可以在6分鐘內接受答案。 – Grigor