Can't locate Switch.pm in @INC

  the perl version (5.14) shipped with 12.10 does not include the Switch.pm module needed while building WebKiT-GTK.

How to install Perl Switch.pm module required to build WebKit-GTK?

  If you want to install the Switch.pm Perl module into your system Perl config, there are two methods of installing it:

  1. Install it through the Ubuntu repositories.
  2. Install the .pm through CPAN.

  At this time, both will provide the current version of this module(2.16).

Installing Switch.pm using the Ubuntu repositories:

  • From the command-line, the installation can be completed by running the following command from the terminal (Ctrl-Alt-t):
  • sudo apt-get install libswitch-perl
    • Within Synaptic, right-click on the libswitch-perl package, select Mark for installation, then click on the Apply button.
    • Within the Ubuntu Software Center (USC), search for the phrase libswitch-perl, highlight the package and select install:

Installing Switch.pm using CPAN:

  If you would prefer to install this via cpan, follow these instructions:

  • Open a terminal(Ctrl-Alt-t).
  • Enter the command cpan.
  • At the prompt cpan[1]>, type install Switch.
  • Once completed, Type exit.

  The Switch.pm Perl module will now be available for you to use in your scripts.

 

参考: 

  http://askubuntu.com/questions/204481/how-to-install-perl-switch-pm-module-required-to-build-webkit-gtk

转载于:https://www.cnblogs.com/yaozhongxiao/p/3811775.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在 Perl 中使用 `use Foo;` 语句导入模块时,Perl 会在 `@INC` 数组中搜索 `Foo.pm` 文件。如果找不到该文件,就会报错 `Can't locate Foo.pm in @INC`。 `@INC` 是 Perl 的一个数组,它包含了 Perl 搜索模块文件的路径。当我们使用 `use` 导入模块时,Perl 会在 `@INC` 数组中搜索与模块名相同的 `.pm` 文件。如果找到了该文件,就会执行其中的代码并将模块中定义的函数、变量或常量导入到当前命名空间中。 如果报错 `Can't locate Foo.pm in @INC`,那么可能是以下原因之一: 1. `Foo.pm` 文件不存在。请检查是否存在名为 `Foo.pm` 的文件,以及该文件是否在 `@INC` 中。 2. `Foo.pm` 文件存在,但是没有在 `@INC` 中。可以使用 `use lib` 语句将文件所在目录添加到 `@INC` 中,例如: ``` use lib '/path/to/Foo'; use Foo; ``` 上面的代码会将 `/path/to/Foo` 目录添加到 `@INC` 中,然后使用 `use Foo;` 导入 `Foo` 模块。 3. `Foo.pm` 文件存在,但是没有权限读取。请检查文件权限是否正确,以及当前用户是否有权限读取该文件。 4. `Foo.pm` 文件存在,但是文件名有误。请检查文件名是否为 `Foo.pm`,以及文件名的大小写是否与 `use` 语句中的模块名一致。 5. `Foo.pm` 文件存在,但是文件中有语法错误。请检查文件中的语法是否正确。 总的来说,解决 `Can't locate Foo.pm in @INC` 错误的方法是找到 `Foo.pm` 文件并将其添加到 `@INC` 中,或者将文件所在目录添加到 `@INC` 中。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值