我在Mac上。我有一个简单的Perl脚本,它使用WWW :: Mechanize :: Firefox来建立一个网页。
当Firefox已在我的计算机上打开并运行时,该脚本可以正常运行。这是创建对象的行:
my $mech = WWW::Mechanize::Firefox->new(
launch => '/Applications/Firefox.app'
);
然而,当Firefox关闭并运行脚本时,我收到以下错误:
exec failed: Permission denied at /Library/Perl/5.12/MozRepl/RemoteObject.pm line 463
at /Library/Perl/5.12/MozRepl/RemoteObject.pm line 463
如何授予perl脚本启动Firefox的权限?
答案 0 :(得分:3)
尝试:
my $mech = WWW::Mechanize::Firefox->new(
launch => '/Applications/Firefox.app/Contents/MacOS/firefox'
);
/Applications/Firefox.app
是应用程序包装器,是包含组成应用程序的各种文件的目录。应用程序包装器中Contents/MacOS/firefox
处的文件是应用程序的主要可执行文件。