我想compilate this scrip,但我有這樣的信息:的Perl:錯誤消息:不容定位...在@INC
無法找到電子郵件/ Address.pm在@INC( @INC包含:C:/草莓/ perl/lib C:/ 草莓/ perl/site/lib C:\ strawberry \ perl \ vendor \ lib。)位於C:/ strawberry/perl/ lib/Regexp/Common/Email/Address.pm line 9. BEGIN失敗 - 在C:/ strawberry/perl/lib/Regexp/Common/Email/ Address.pm第9行中斷編譯。 編譯在(eval 1)第1行。 BEGIN失敗 - 編譯在C:\ examples \ script2.pl中止第4行
我不理解,因爲我真的有這根
C:/strawberry/perl/lib/Regexp/Common/Email/Address.pm
有沒有人知道爲什麼當我嘗試編寫我的腳本時出現此錯誤消息?
謝謝你這麼多
我試圖用這樣一句話:
使用LIB 'C:/草莓/ perl的/ lib目錄/正則表達式/通用/電子郵件';
,並把作爲評價這兩個句子:
use Regexp::Common qw[Email::Address];
use Email::Address
然後我得到這個錯誤
Global symbol "%RE" requires explicit package name at C:\examples\script2.pl lin
e 10.Execution of C:\examples\script2.pl aborted due to compilation errors.
從來就在perldiag
全局符號採取一看「 %s「需要明確的包名稱 (F)你已經表示「使用嚴格」或「使用嚴格變量」,這表明所有變量必須是詞法範圍的(使用「我的」或「狀態」),事先使用「我們的」聲明,或者顯式限定全局變量在(使用「::」)。
但我覺得它對我來說有點理論,因爲我明白你必須在代碼的開始使用'use'這個句子來使用包。
順便說一句,這是我的代碼:
use Regexp::Common qw[Email::Address];
use Email::Address;
while (<>) {
my (@found) = /($RE{Email}{Address})/g;
my (@addrs) = map $_->address, Email::Address->parse("@found");
print "X-Addresses: ", join(", ", @addrs), "\n";
}
我得到這個代碼from a question I asked before.