[TxMt] tiny improvements for perlmate.rb
Alexander Ross
alex.j.ross at gmail.com
Fri Dec 1 06:49:52 UTC 2006
James,
I tried this out but couldn't get it to work. $@ wasn't set when the
END block was called.
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)".
- Alex
[1] http://perldoc.perl.org/Carp.html
On Nov 30, 2006, at 4:27 PM, James Edward Gray II wrote:
> On Nov 30, 2006, at 6:07 PM, Hans-Joerg Bibiko wrote:
>
>> Alex,
>>
>>> The the reason we don't want to handle errors that were throw in
>>> eval
>>> blocks is the reason you mentioned. Typically, the user handles the
>>> error themself. But it is bad that $@ refers to
>>> exception_handler.pm
>>> line 34 after a die. I think we can fix this somehow.
>>>
>> Try the attached exception_handler.pm.
>
> Hmm, can't Perl exception catching be done the way we do it in
> Ruby? My Perl is rusty but a close translation would be something
> like the following (I think):
>
> END {
> if ($@) {
> # we are exiting with an exception here...
> }
> }
>
> James Edward Gray II
>
> ______________________________________________________________________
> For new threads USE THIS: textmate at lists.macromates.com
> (threading gets destroyed and the universe will collapse if you don't)
> http://lists.macromates.com/mailman/listinfo/textmate
More information about the textmate
mailing list