[TxMt] tiny improvements for perlmate.rb
Hans-Joerg Bibiko
bibiko at eva.mpg.de
Fri Dec 1 08:52:19 UTC 2006
On 1 Dec 2006, at 07:49, Alexander Ross wrote:
> James,
>
> I tried this out but couldn't get it to work. $@ wasn't set when
> the END block was called.
? Did you tried out my version with 'exit(1) if(!$^S);'?
If yes could you please send me an example script which doesn't work.
What do you mean with: "$@ wasn't set when the END block was called"?
I'm dealing with $^S.
>
> The good news is if we are in an eval block, exception_handler::die
> can call Carp::croak[1]. Which "dies of errors (from perspective
> of caller)".
>
Yes, to use Carp is a very good idea. You can call in perlmate.rb
def args
["-I#{e_sh(Pathname.new(ENV['TM_BUNDLE_SUPPORT']) + "PerlMate")}",
"-Mexception_handler", "-MCarp=verbose"]
end
and write within the 'sub die' (excep... .pm)
print TM_ERROR_FD "<p>".Carp::longmess()."</p";
which will print something like
at /Users/.../untitled.pl line 8 eval {...} called at /Users/.../
untitled.pl line 6
-Hans
More information about the textmate
mailing list