I don't think anyone has yet answered your first question --
What are the advantages to using Perl over AppleScript or vice versa?
AppleScript has the advantage that it's a little bit easier to learn for some folks, particularly non-programmers who view it as being more english-like. The advantage to programmers is that many programs have exposed an AppleScript API, so that people can write macros. AppleScript can also 'record' actions, making it even more like a macro writing language.
You can also be more assured that if the person's using a Mac, they'll have AppleScript -- even if it's pre-MacOS X.
What are the advantages of Perl? Well, I'm guessing in your case, you're more familiar with Perl, and if you're been using it for any sort of time, it's much more productive to work in a language you're familiar with, than to have to keep referring back to language documentation, and debug it.
But, Perl can't interfact with the applications -- for instance, to keep this on topic -- in BBEdit, it'll mark perl functions, so that you can quickly jump down to them. It doesn't, however, mark when you change packages within the same file, so the function scanner isn't useful when you're reading through SOAP::Lite or things written in a similar style. I use an AppleScript to set marks at the 'package' and 'sub' declarations (but it's on my machine at work, so I'll have to post it from there)
Update: Almost forgot to mention -- there are Applescript modules in CPAN, to call AppleScript from Perl
Update 2: AppleScript to mark Perl namespaces in BBEdit
tell application "BBEdit" activate mark text 1 of active document of text window 1 options {searching + for:"\\bpackage\\s+([a-zA-Z:0-9_]+)\\s*;", using:"\\1", clearing exi +sting:true} mark text 1 of active document of text window 1 options {searching + for:"\\bsub\\s+([a-zA-Z0-9_]+)\\s*(?:\\([^)]\\)\\s*)?{", using:" \\ +1", clearing existing:false} end tell
In reply to Re: Where does Perl fit into OS X?
by jhourcle
in thread Where does Perl fit into OS X?
by Acolyte
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |