nysus has asked for the wisdom of the Perl Monks concerning the following question:
I'm creating commands that I can execute by voice for my Mac. In order to do this, I want to create AppleScripts that call my perl script. For example, here's an AppleScript that will call a Perl script which moves files off the Desktop and into Documents folder:
do shell script "/Users/stevied/bin/clean_desktop.pl"
The Perl script works fine when run from the command line, but when executing the script from my AppleScript, the modules I use aren't found and I get this error:
Can't locate Modern/Perl.pm in @INC (you may need to install the Moder +n::Perl module) (@INC contains: /Library/Perl/5.18/darwin-thread-mult +i-2level /Library/Perl/5.18 /Network/Library/Perl/5.18/darwin-thread- +multi-2level /Network/Library/Perl/5.18 /Library/Perl/Updates/5.18.2 +/System/Library/Perl/5.18/darwin-thread-multi-2level /System/Library/ +Perl/5.18 /System/Library/Perl/Extras/5.18/darwin-thread-multi-2level + /System/Library/Perl/Extras/5.18 .) at /Users/stevied/bin/clean_desk +top.pl line 3. BEGIN failed--compilation aborted at /Users/stevied/bi +n/clean_desktop.pl line 3.
I have perlbrew installed. The current shebang line for the perl script is #! /usr/bin/env perl. I tried adding the following line to my perl script:
/Users/stevied/perl5/lib/perl5;
Running the AppleScript now yields this horrific looking error:
dyld: lazy symbol binding failed: Symbol not found: _Perl_xs_handshake Referenced from: /Users/stevied/perl5/lib/perl5/darwin-thread-multi- +2level/auto/Mac/SystemDirectory/SystemDirectory.bundle Expected in: flat namespace dyld: Symbol not found: _Perl_xs_handshake Referenced from: /Users/stevied/perl5/lib/perl5/darwin-thread-multi- +2level/auto/Mac/SystemDirectory/SystemDirectory.bundle Expected in: flat namespace
Is there anything I can do to get this working?
$PM = "Perl Monk's";
$MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon Curate";
$nysus = $PM . ' ' . $MCF;
Click here if you love Perl Monks
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: How do you run a perl script using a custom perl build from an AppleScript?
by kevbot (Vicar) on May 27, 2017 at 20:53 UTC | |
by nysus (Parson) on May 28, 2017 at 08:58 UTC | |
|
Re: How do you run a perl script using a custom perl build from an AppleScript?
by huck (Prior) on May 27, 2017 at 21:56 UTC | |
by soonix (Chancellor) on May 30, 2017 at 06:26 UTC | |
|
Re: How do you run a perl script using a custom perl build from an AppleScript?
by duelafn (Parson) on May 27, 2017 at 21:29 UTC |