Usually Perl gives me nice and helpful error messages. On my new Mini it's not. I installed newer Perl than Apple currently provide using perlbrew and have my shebang line: #!/Users/justin/perl5/perlbrew/perls/perl-5.16.2/bin/perl
My perl programs report helpful debug messages at the command line, but when I hit Cmd+r to have TM run the program they look like this:
BEGIN not safe after errors--compilation aborted at /Users/justin/perl5/perlbrew/perls/perl-5.16.2/lib/5.16.2/Carp/Heavy.pm line 3. Compilation failed in require at /Applications/TextMate.app/Contents/SharedSupport/Bundles/Perl.tmbundle/Support/exception_handler.pm line 30.
My TM_PERL variable is also: /Users/justin/perl5/perlbrew/perls/perl-5.16.2/bin/perl
Reading through the exception_handler.pm file I see that line 30 is 'require Carp::Heavy…'. When I tried to install Carp/Heavy.pm using cpan it said that the module is up to date.
Any suggestions on what's not right here?
On Mar 12, 2013, at 4:57 PM, Justin Catterall 100621.1@masonsmusic.co.uk wrote:
[…] Reading through the exception_handler.pm file I see that line 30 is 'require Carp::Heavy…'. When I tried to install Carp/Heavy.pm using cpan it said that the module is up to date.
Any suggestions on what's not right here?
Does running this (in a terminal) work:
/Users/justin/perl5/perlbrew/perls/perl-5.16.2/bin/perl -e 'require Carp::Heavy'
If not, you likely tried to install the module for the system default perl, but you need to install it for the version of perl that you installed via homebrew.
On 12 Mar 2013, at 16:22, Allan Odgaard mailinglist@textmate.org wrote:
On Mar 12, 2013, at 4:57 PM, Justin Catterall 100621.1@masonsmusic.co.uk wrote:
[…] Reading through the exception_handler.pm file I see that line 30 is 'require Carp::Heavy…'. When I tried to install Carp/Heavy.pm using cpan it said that the module is up to date.
Any suggestions on what's not right here?
Does running this (in a terminal) work:
/Users/justin/perl5/perlbrew/perls/perl-5.16.2/bin/perl -e 'require Carp::Heavy'
If not, you likely tried to install the module for the system default perl, but you need to install it for the version of perl that you installed via homebrew.
That command runs without error (I did a copy and paste to ensure no typos). To check it I replaced Carp::Heavy with Lies::DamnLies and got the expected error.
I forgot to mention this is TM 1.5.11 (1635).
I've looked at this some more and can't see what might be wrong.
Hi Justin and Allan,
that error message rings some distant bells for me: maybe it's related to Perl's taint mode? Why would we be seeing a taint-related problem after changing the binary that "perl" points to? Perhaps because the file "perlcheckmate.pl" in the Perl bundle's support folder has a slightly mysterious shell-out to perl with -T turned on: line 33 of that file reads
my @lines = `perl -Tcw "$file" 2>&1`;
I'm guessing that if your path to the new perl may not be secure, or something like that --as per taint's requirements-- that message you're seeing might come flying out the other end. See "perldoc perlsec" for what triggers taint mode.
Anyway, easy to check if I'm blowing my usual volume of hot air here: just remove the taint check (ie the "T" in the line quoted) and see if the error still appears. Then you can start the hunt in earnest!
Good luck, Paul
On 13 Mar 2013, at 10:15, Paul McCann pmccann@gmail.com wrote:
Hi Justin and Allan,
that error message rings some distant bells for me: maybe it's related to Perl's taint mode? Why would we be seeing a taint-related problem after changing the binary that "perl" points to? Perhaps because the file "perlcheckmate.pl" in the Perl bundle's support folder has a slightly mysterious shell-out to perl with -T turned on: line 33 of that file reads
my @lines = `perl -Tcw "$file" 2>&1`;
I'm guessing that if your path to the new perl may not be secure, or something like that --as per taint's requirements-- that message you're seeing might come flying out the other end. See "perldoc perlsec" for what triggers taint mode.
Anyway, easy to check if I'm blowing my usual volume of hot air here: just remove the taint check (ie the "T" in the line quoted) and see if the error still appears. Then you can start the hunt in earnest!
Good luck, Paul
Thanks for the pointer, Paul. Unfortunately that doesn't seem to be the solution. I removed the "T", opened a script, ran it to check it worked and that was fine, but if I introduced an error I got the same "exception_handler.pm" error, and not the usual useful Perl error messages.
I might try a perl newsgroup.
Hi Justin, I don't know if you have solved your issue already, but here there's a viable workaround:
/add a "use Carp::Heavy;" statement to your scripts./
I've been having this problem myself since forever, and the workaround solved the issue for me. Still I don't have a sound technical explanation of HWY this happens, nor a cleaner solution.
I found this workaround here http://textmate.1073791.n5.nabble.com/TextMate-perl-bundle-issues-td14163.html .
Please let me know if you find a better solution!
Kind regards, Giovanni
-- View this message in context: http://textmate.1073791.n5.nabble.com/Perl-Cmd-r-not-giving-useful-error-mes... Sent from the textmate users mailing list archive at Nabble.com.