• 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: Run Perl Source Text Directly from AppleScript – List AppleScript Library Handlers
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Run Perl Source Text Directly from AppleScript – List AppleScript Library Handlers


  • Subject: Re: Run Perl Source Text Directly from AppleScript – List AppleScript Library Handlers
  • From: debt <email@hidden>
  • Date: Tue, 14 Mar 2017 08:30:44 -0700

On Mar 12, 2017, at 8:23 PM, Christopher Stone <email@hidden> wrote:

Most notably I added the source ~/.profile command and tweaked the Perl code slightly.

Hey Chris,

It’s nice to see someone else on this list using Perl, even though 5.12 is pretty old at this point.  Is that the version that comes with Sierra?  If so, Apple should be ashamed of themselves. :(  Perl’s already up to 5.24.1, and version 5.26 is due out shortly.

I hope you don’t mind, but I would add a couple of things to your script, especially for people who aren’t well versed in Perl.  The first would be to add

use warnings;

to let you know when and where things go wrong.  Especially when embedded within AppleScript, any errors in the Perl code may be hard to spot by eye.  Also, anyone using Perl 5.10 or lower (God forbid!) will want to add

use strict;

to catch any Perl syntax errors.

<personal_opinion>

Although I like the fact that Perl code can be embedded within AppleScript, I personally don’t like doing it because there’s too much escaping of the characters going on which makes it look ugly, IMHO.  Using BBEdit will give you syntax highlighting and it's compare documents feature is second to none (they even have a free version now).  It’s almost like a Script Debugger for other languages.  I couldn’t operate without either one now.

</personal_opinion>

Marc
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users

This email sent to email@hidden

  • Follow-Ups:
    • Re: Run Perl Source Text Directly from AppleScript – List AppleScript Library Handlers
      • From: Christopher Stone <email@hidden>
    • Re: Run Perl Source Text Directly from AppleScript – List AppleScript Library Handlers
      • From: "Jacopille, David" <email@hidden>
References: 
 >Run Perl Source Text Directly from AppleScript – List AppleScript Library Handlers (From: Christopher Stone <email@hidden>)

  • Prev by Date: Re: notes to pdf
  • Next by Date: Re: Run Perl Source Text Directly from AppleScript – List AppleScript Library Handlers
  • Previous by thread: Run Perl Source Text Directly from AppleScript – List AppleScript Library Handlers
  • Next by thread: Re: Run Perl Source Text Directly from AppleScript – List AppleScript Library Handlers
  • Index(es):
    • Date
    • Thread