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

Re: Perl syntax


  • Subject: Re: Perl syntax
  • From: John Delacour <email@hidden>
  • Date: Sat, 14 Jun 2003 15:31:11 +0100
  • Mac-eudora-version: 6.0b20

At 9:26 am -0400 14/6/03, Greg Townsend wrote:

set shellscript to "
use IMDB;

[...]

do shell script "perl " & shellscript

However, I just get execution errors (or "no such file errors" if I use 'quoted form of shellscript'). I can't find any information anywhere on what the proper syntax should be.

if you're using the routine << do shell script "perl " & path.pl >>, then your script must be in path.pl complete with shebang + UNIX line ending.

Try something like this:

set fU to "/tmp/temp.pl"
set f to fU as POSIX file
set shebang to "#!/usr/bin/perl" & (ASCII character 10)
set _script to shebang & "use IMDB;
$imdb = IMDB->new();
%res_1 = $imdb->query('title' => 'star trek');
print \"-> $_ = $res_1{$_}\" foreach sort keys %res_1;
%res_2 = $imdb->query('title' => 'pulp fiction');
print \"-> $_ = $res_2{$_}\" foreach sort keys %res_2;"
open for access f with write permission
set eof f to 0
write _script to f
close access f
do shell script "perl " & fU

JD




.
_______________________________________________
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: Perl syntax
      • From: Christopher Nebel <email@hidden>
References: 
 >Perl syntax (From: Greg Townsend <email@hidden>)

  • Prev by Date: Re: Perl syntax
  • Next by Date: Re: how to make 'mail' send
  • Previous by thread: Re: Perl syntax
  • Next by thread: Re: Perl syntax
  • Index(es):
    • Date
    • Thread