• 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: Do Perl Script?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Do Perl Script?


  • Subject: Re: Do Perl Script?
  • From: Christopher Nebel <email@hidden>
  • Date: Fri, 6 Jun 2003 21:29:56 -0700

On Friday, June 6, 2003, at 04:32 PM, John Delacour wrote:

...it works quite easily with perl -e:

Wait till it stumbles across a single quote.

The upshot of this is: use the appropriate technique for the task. The exact limits depend on your personal tolerances, but the rule of thumb I use is to use "perl -e" for anything less than 5 lines of Perl.

So long as you have no single quotes etc. lying around. If the data it has to deal with are predictable, then fine. If unknown file contents are to be handled, then perl -e is out.

Single quotes are not an issue with "quoted form". (If you didn't have "quoted form", then I'd heartily agree with you.) In fact, your example used them; this one uses both single and double:

set perl_script to "print 'Hello' . \" world\""
do shell script "perl -e " & quoted form of perl_script
--> "Hello world"

Now, your point about unknown file contents is probably correct, but not for the single quoting reason. There are definite size limits on how much stuff you can pass as a parameter.


--Chris Nebel
Apple Development Tools
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Do Perl Script?
      • From: John Delacour <email@hidden>
References: 
 >Re: Do Perl Script? (From: John Delacour <email@hidden>)

  • Prev by Date: Re: Forcing Terminal to not resize
  • Next by Date: Re: Strange Bottleneck
  • Previous by thread: Re: Do Perl Script?
  • Next by thread: Re: Do Perl Script?
  • Index(es):
    • Date
    • Thread