为什么我无法在@INC

时间:2016-07-10 00:32:36

标签: perl cpan

好的,所以我一直试图让这个来源为我的游戏工作,但在我安装所有模块后,我在终端收到此错误。

PS C:\Users\NAME\desktop\Luna> perl Run.pm
Can't locate Module/Find.pm in @INC (@INC contains: C:/Perl64/site/lib C:/Perl64/lib .) at Run.pm line 8.
BEGIN failed--compilation aborted at Run.pm line 8.

我不明白我为什么会得到它

这里是第8行

use Module::Find;

有谁知道为什么会这样?

2 个答案:

答案 0 :(得分:1)

这指出了为什么了解使用计算机选择使用的一点是很重要的。在这种情况下,您有两个Perl安装。其中一个perl.exe住在c:\perl64\bin(我假设是ActivePerl)。其他perl.exe位于c:\strawberry\perl\bin。您似乎设法安装(可能通过cpanm只显示在c:\strawberry\perl\bin Module::Find Strawberry Perlc:\perl64\bin

显然,在您的环境中,c:\strawberry\perl\bin出现在perl Run.pm之前。因此,您perl调用该目录中的perl -V). ActiveState's。每个安装都有许多默认位置,用于查找模块(您可以使用perl列出那些perl.exe`,不会在Strawberry Perl的目录中查找模块。

可以在Windows中和平地共存多个Perl安装,但由于shortcomings tools生成调用已安装的Perl脚本的批处理文件,因此它变得比必要复杂。这些工具只调用perl.exe而不是将完整路径放到用于创建批处理文件的<% String eid = request.getParameter("eid"); String first_name = request.getParameter("first_name"); if(eid != null && first_name != null){ Connection conn = null; Statement stmt = null; ResultSet result = null; Class.forName("oracle.jdbc.driver.OracleDriver").newInstance(); try{ conn = DriverManager.getConnection("jdbc:oracle:thin:@localhost:1521:xe","system","Password"); PreparedStatement ps = null; String query = "insert into employee(eid,ename) values(?,?)"; ps = conn.prepareStatement(query); ps.setString(1,eid); ps.setString(2,first_name); ps.executeUpdate(); }catch(SQLException sqle){ //log sql exception } finally { if(conn != null){ try{ conn.close(); }catch(SQLException sqle){ //log exception } } } %>

在此成为默认设置之前,我发现处理这种情况的最简单方法是将一个Perl发行版指定为我的默认设置,并使用一些批处理文件和符号链接技巧在其他设备之间切换。

答案 1 :(得分:-1)

转到 CPAN 命令提示符(对于 perl C:\Strawberry\perl\bin)

cpan> 安装

或任何例如

安装 Locale::Language

相关问题