Re: perl scripting in AppleScript
Re: perl scripting in AppleScript
- Subject: Re: perl scripting in AppleScript
- From: Doug McNutt <email@hidden>
- Date: Tue, 23 Dec 2003 09:28:00 -0700
At 22:49 -0600 12/22/03, John Fowler wrote:
>
I understand that -e expects one line of _program_ and I am happy with that. I didn't expect that this meant the program could only process one line of _input_ from a file. I gather from your comment that this is so however.
That is not the case. Once started your perl script can read any file it can legally access.
One possibility is that your perl script is reading "lines" of a file which has line endings it doesn't accept. The result is that perl reads the whole file as one line. Set $/ to "\r" for Mac files. \n is the default. You can also use the -octal switch in perl. It's really a dash-zero-followed by the octal representation of the line end character.
Do shell script can be used to execute your own shell script which can be an executable tcsh or bash script or a perl script or a compiled program. Bash is the default but others can be executed so long as they begin with:
#!/usr/bin/perl
#!/bin/tcsh
or the like. Look up 'shebang" for more. The x permission bit needs to be set and Finder doesn't support that so one has to use chmod from (perish the thought) Terminal or perhaps a supporting do shell script. If your shell operations require more than an 80 character card it's better to create the script with an editor and simply execute it with a full-path name from AppleScript.
--
--> Life begins at ovulation. Ladies should endeavor to get every young life fertilized. <--
_______________________________________________
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.