如何在macOS上安装perl模块? [英] how do I install perl modules on macos?
问题描述
线程>安装缺少的Perl的最简单方法是什么模块?,我做了
The thread perl how can I append STDOUT of list form system call of perl script to a file led to the following solution: use IPC::Run qw( run );
. On my macos 10.14.6 running perl 5.18.4, this threw an error: Can't locate IPC/Run.pm in @INC (you may need to install the IPC::Run module)
. Accordingly, following What's the easiest way to install a missing Perl module?, I did
> cpan IPC::Run
<snip: 403 lines later>
Appending installation info to /Users/BNW/perl5/lib/perl5/darwin-thread-multi-2level/perllocal.pod
TODDR/IPC-Run-20180523.0.tar.gz
/usr/bin/make install -- OK
,然后重新启动了MacBookPro.然后我编辑了Perl脚本bosswrap.pl
以开始
and rebooted my MacBookPro. And I edited my perl script, bosswrap.pl
, to start
#!/usr/bin/perl
use strict; use warnings;
use IPC::Run qw( run );
但这又会引发与以前相同的错误:
but this again throws apparently the same error as before:
> bosswrap.pl
Can't locate IPC/Run.pm in @INC (you may need to install the IPC::Run module) (@INC contains: /sw/lib/perl5/darwin-thread-multi-2level /sw/lib/perl5 /sw/lib/perl5/darwin /Library/Perl/5.18/darwin-thread-multi-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread-multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.4 /System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level /System/Library/Perl/Extras/5.18 .) at /Users/BNW/u/kh/bin/bosswrap.pl line 3.
BEGIN failed--compilation aborted at /Users/BNW/u/kh/bin/bosswrap.pl line 3.
我在做错什么,或者更确切地说,如何使它正常工作?
What am I doing wrong, or rather, how can I get this to work?
推荐答案
尝试以下操作:
sudo perl -MCPAN -e 'install -force Net::ARP'
这篇关于如何在macOS上安装perl模块?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!