Shlomi Fish wrote:
>>> - if ($@ and $@ !~ /alarm clock restart/) { die }
>>> +
>>> + if ($@ and $@ !~ /alarm clock restart/) { die; }
>> Since you're touching this anyway adding a message to the die would be
>> useful.
>
> Doesn't it rethrow the exception as it is?
die LIST
[....]
If LIST is empty and $@ already contains a value (typically
from a previous eval) that value is reused after appending
"\t...propagated". This is useful for propagating exceptions:
eval { ... };
die unless $@ =~ /Expected exception/;
Looks correct to me, although as I hate having to remember/search for special
cases like this, I'd prefer
if ($@ and $@ !~ /alarm clock restart/) { die $@ }
although this is not technically the same thing.
J
--
("`-''-/").___..--''"`-._ | Jacinta Richardson |
`6_ 6 ) `-. ( ).`-.__.`) | Perl Training Australia |
(_Y_.)' ._ ) `._ `. ``-..-' | +61 3 9354 6001 |
_..`--'_..-_/ /--'_.' ,' | [email protected] |
(il),-'' (li),' ((!.-' | www.perltraining.com.au |