简体   繁体   English

如何使用perl模块?

[英]How to use a perl module?

I have installed PAR from CPAN. 我从CPAN安装了PAR。 Now, how do you use it? 现在,您如何使用它? It gives usage example as: 它给出的用例如下:

% pp -o hello hello.pl %pp -o hello hello.pl

How do you use this on Windows? 您如何在Windows上使用它? pp gives "command not found". pp给出“命令未找到”。

I am new to perl. 我是perl的新手。 Only thing I need is to run a module. 我只需要运行一个模块。

pp isn't a module, it is an application. pp不是模块,它是一个应用程序。 You need to figure out where it was installed to (I don't know which perl you are using or how you installed it) and use the full path to it. 您需要弄清楚它的安装位置(我不知道您正在使用哪个Perl或如何安装它),并使用它的完整路径。

You should look in your lib directory to ensure that the pp.pm file exists somewhere. 您应该在lib目录中查找,以确保pp.pm文件存在于某处。 then, you can load it up by typing use Par::pp; 然后,您可以通过键入use Par::pp;来加载它use Par::pp; at the perl command line (i'm guessing that it is part of PAR based on what i've found, it could be something as simple as use pp; at the command line). 在perl命令行(我猜它是PAR的一部分,基于我发现的东西,它可能就像use pp;一样简单use pp;在命令行)。

once the module is loaded, it should provide the pp command for you to use. 加载模块后,应提供pp命令供您使用。

thanks, mark 谢谢,马克

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM