note
TGI
<p>I like statement modifiers at the end for simple things like an early return, or throwing an exception. To handle longer lines I use indention:
<c>
die 'Detailed error messages are important, especially when this error happens'
if $oops;
</c>
<p>But with the long exception you showed I might do:
<c>
Exception::Of::Doom->throw(
error => 'Detailed error messages are important, especially when this error happens',
) if $oops;
</c>
<p>I often hear that switching the order is difficult and that it is a good reason not to use the trailing conditional. In practice, I haven't found that switching the conditional around to be that onerous. A good text editor makes it easy. If switching was so hard you would see more of this:
<c>
do {
turn_green();
throw_up();
die "Ach, food poisoning";
) if $ptomaine;
</c>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-25825">
<P><BR>TGI says <B>moo</B></P>
</div></div>
727817
727827