• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: NSTask, Perl, HTML
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSTask, Perl, HTML


  • Subject: Re: NSTask, Perl, HTML
  • From: Don Briggs <email@hidden>
  • Date: Wed, 14 Jan 2004 13:19:32 -0800

Hi, Kevin 

I think I can help.

[1] Use the PerlObjCBridge. See the article
Cocoa and Perl  There's More Than One Way to Do It
http://cocoadevcentral.com/articles/000076.php

In the article, a Cocoa application launches a Perl task.
The Cocoa app provides the UI but relies on the Perl task for its "computation."
It requires no third-party framework.

[2] The example in the article passes integers across the PerlObjCBridge but there's no problem passing any other Foundation class.
You might pass the HTML directly as an instance of NSData from Cocoa to Perl.
The Perl can return an NSString if you like.

You might want to pass an NSDictionary to Perl. One key, say @"HTML data", might have as its object the NSData above, and other keys might provide some "context" if necessary.

[3] I haven't looked for memory leaks in the example.

All best,
Don

On Jan 14, 2004, at 3:50 PM, Kevin Wojniak wrote:

My program currently does parsing of HTML through some Objective-C and PHP (loaded off a server).

I want to be able to parse content out of HTML using Perl, but here's my problem. I want the Cocoa program to manage downloading the HTML (through CURLHandle), then it passes to a Perl script the HTML data, and the Perl script returns the parsed string. But how would I pass a huge HTML document through NSTask to a Perl script...and if I could, would there be any memory issues or what not?? (maybe this is simple and I'm just a noob..)

Thanks,
Kevin
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

References: 
 >NSTask, Perl, HTML (From: Kevin Wojniak <email@hidden>)

  • Prev by Date: Re: NSTask, Perl, HTML
  • Next by Date: Re: NSDate and Date formatters
  • Previous by thread: Re: NSTask, Perl, HTML
  • Next by thread: Re: Horizontal scrollbar is not activated in TableView
  • Index(es):
    • Date
    • Thread