I am a beginner in Cocoa. I am trying to execute a perl script from my class, and I am not getting any results, below is the code:
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];
I get the following text
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
The execution of the code stops right there. I am not sure what I am doing wrong, can someone please point me in the right direction. Thanks.
You need to execute
/usr/bin/perl, not/usr/bin/pl.