Re: Shell Script Not Working from AppleScript Call
Re: Shell Script Not Working from AppleScript Call
- Subject: Re: Shell Script Not Working from AppleScript Call
- From: "Mark J. Reed" <email@hidden>
- Date: Sun, 24 Aug 2008 22:24:31 -0400
Curl is very useful for shell scripts, but I have never seen the need
to shell out to it from Perl. If you're in Perl, just use
LWP::Simple.
use LWP::Simple;
my $content = get($url);
If you need to do something fancier, you can use the not-so-Simple
full version of the LWP module, but it's a pain. I would then indeed
recommend using curl, but by installing the Perl interface to the curl
library from CPAN (WWW::Curl) rather than shelling out to the command.
As a general rule, if you find yourself calling out to shell commands
from Perl, You're Doing It Wrong. :) Obviously, that's just a
guideline and not an absolute, but whenever I start to reach for
backicks or system() I stop to ask myself if there's a way to do it in
pure Perl (or with a Perl interface to a C shared lib), possibly via a
CPAN module I just haven't installed yet.
The same goes for "do shell script" from Applescript, but there it
more often seems to be the case that the answer is "no", or "yes, but
it's a major pain", or "yes, but it's a lot slower".
_______________________________________________
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