首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >从Xcode4.2执行Perl脚本

从Xcode4.2执行Perl脚本
EN

Stack Overflow用户
提问于 2011-11-17 15:40:12
回答 1查看 1.1K关注 0票数 1

我是可可的初学者。我正在尝试执行我的类中的perl脚本,但没有得到任何结果,以下是代码:

代码语言:javascript
复制
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMast, YES);
NSString *documentDir = [paths objectAtIndex:0];
NSString *path = [documentDir stringByAppendingPathComponent:@"detect.pl"];

NSMutableArray *someArray = [[NSMutableArray alloc] initWithObjects:path, nil];

[[NSTask launchedTaskWithLaunchPath:[NSString stringWithFormat:@"/usr/bin/pl"] arguments:someArray] waitUntilExit];

我得到了以下文本

代码语言:javascript
复制
pl {-input <file>} {-output <file>}
   Reads ASCII PL from stdin (or file if -input specified)
   and writes ASCII PL to stdout (or file if -output)
   NOTE: binary serialization is no longer supported 

代码的执行就到此为止了。我不知道我做错了什么,有人能给我指个方向吗?谢谢。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-11-17 16:39:47

您需要执行/usr/bin/perl,而不是/usr/bin/pl

票数 3
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/8163613

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档