且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Perl:错误消息:在@INC中找不到...

更新时间:2023-11-18 15:36:52

我认为问题是,您确实有 Regexp :: Common :: Email :: Address 已安装。但是,您还需要 Email :: Address ,这是一个单独的模块。也就是说,您还应该在 C:/strawberry/perl/lib/Email/Address.pm 中安装一个模块。

I think the issue is, you do have Regexp::Common::Email::Address installed. However, you also need Email::Address, which is a separate module. That is to say, you should also have a module installed in C:/strawberry/perl/lib/Email/Address.pm.

尝试使用cpan安装 Email :: Address ,请参阅

Try using cpan to install Email::Address, see What's the easiest way to install a missing Perl module?

更新后会有更多解释:

Perl模块是以分层方式组织的。 :: 包分隔符等于模块库路径中的目录。模块的全名/含义来自程序包本身的名称和安装路径。假设您有名为 Restaurant :: Bill Hat :: Bill 名称的模块: :Male :: Bill 。您将拥有三个名为 Bill.pm 的文件,但它们代表了截然不同的概念。它们将通过模块库中的路径相互区分。

Perl modules are organized in a hierarchical manner. The :: package separator is equal to a directory in your module library path. The full name/meaning of the module is derived from both the name of the package itself and the path in which it is installed. Suppose you had modules called Restaurant::Bill, Hat::Bill, and Names::Male::Bill. You would have three different files called Bill.pm, but they would represent very different concepts. They would be distinguished from each other by their paths in your module library.