title: Executing Perl Scripts from Xcode 4.2
body: <p>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:</p>
  
  <pre><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];
  </code></pre>
  
  <p>I get the following text</p>
  
  <pre><code>pl {-input &lt;file&gt;} {-output &lt;file&gt;}
     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 
  </code></pre>
  
  <p>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.</p>