Hi,
I have started to use Homebrew's Perl and its CPAN to avoid having to mess with the Macs Protection mechanism.
The CPAN libraries/modules are installed under ~/perl5 necesstitting to run
PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib
and adding this to the end of ~/.profile
eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)"
which sets
PERL_MB_OPT='--install_base "/Users/el/perl5"' PERL_MM_OPT=INSTALL_BASE=/Users/el/perl5
(in my case).
I have set TM_PERL to /usr/local/bin/perl and when I run a perl program wit CMD-R it works, unless I use a CPAN module when I get this message (under TextMate, but NOT from the command line):
Can't locate DBI.pm in @INC (you may need to install the DBI module) (@INC contains: /Users/el/Library/Application Support/TextMate/Managed/Bundles/Perl.tmbundle/Support /usr/local/Cellar/perl/5.28.1/lib/perl5/site_perl/5.28.1/darwin-thread-multi-2level /usr/local/Cellar/perl/5.28.1/lib/perl5/site_perl/5.28.1 /usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1/darwin-thread-multi-2level /usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1 /usr/local/lib/perl5/site_perl/5.28.1) at /Users/el/Downloads/epplog.pl line 4. BEGIN failed--compilation aborted at /Users/el/Downloads/epplog.pl line 4.
When I add this to the front of the script
BEGIN { $WHOAMI = getpwuid($<); $LOCALPERL5 = "/Users/$WHOAMI/perl5/lib/perl5"; push @INC, $LOCALPERL5; } ## end BEGIN use lib "/Users/$WHOAMI/perl5/lib/perl5";
it runs under TextMate.
If I run Tidy I get this message
Can't locate Perl/Tidy.pm in @INC (you may need to install the Perl::Tidy module) (@INC contains: /usr/local/Cellar/perl/5.28.1/lib/perl5/site_perl/5.28.1/darwin-thread-multi-2level /usr/local/Cellar/perl/5.28.1/lib/perl5/site_perl/5.28.1 /usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1/darwin-thread-multi-2level /usr/local/Cellar/perl/5.28.1/lib/perl5/5.28.1 /usr/local/lib/perl5/site_perl/5.28.1) at /usr/local/bin/perltidy line 2. BEGIN failed--compilation aborted at /usr/local/bin/perltidy line 2.
which disappears if I prefix the above BEGIN/Use block into /usr/local/bin/perltidy (which works from the command line).
I have tried to set TM_PERLTIDY to /usr/local/bin/perltidy but makes no difference.
Does anyone have an idea what I must set to be able not have to use the BEGIN/use block any longer (for both issues)?
greetings, el
On 1 Mar 2019, at 10:42, Dr Eberhard W Lisse wrote:
I have started to use Homebrew's Perl and its CPAN to avoid having to mess with the Macs Protection mechanism.
The CPAN libraries/modules are installed under ~/perl5 necesstitting to run
PERL_MM_OPT="INSTALL_BASE=$HOME/perl5" cpan local::lib
and adding this to the end of ~/.profile
eval "$(perl -I$HOME/perl5/lib/perl5 -Mlocal::lib=$HOME/perl5)"
which sets
PERL_MB_OPT='--install_base "/Users/el/perl5"' PERL_MM_OPT=INSTALL_BASE=/Users/el/perl5
(in my case).
I have set TM_PERL to /usr/local/bin/perl and when I run a perl program wit CMD-R it works, unless I use a CPAN module when I get this message (under TextMate, but NOT from the command line):
If not already done, you need to explicitly set `PERL_MB_OPT` and `PERL_MM_OPT` in TextMate, either Preferences → Variables or add them to your `~/.tm_properties` file.
TextMate does not run your `~/.profile` and therefore does not pick up the `eval` line you have there.