Maybe it's my old brain, but I like using "return" in this context for code that isn't being submitted to a PerlGolf competition.<br><br>I've encountered enough bad/sketchy coding that didn't define a return value for a subroutine that I would be suspicious if the original programmer /meant/ to return the $self->send() value, or if they thought they were calling some other routine (and the return value was just a by-product/accident).<br>
<br>Golf is great, but it isn't always productive. (Much like "real golf".)<br><br>DanL<br><br><div class="gmail_quote">2010/4/21 Theodore Katseres <span dir="ltr"><<a href="mailto:tedkat@gmail.com">tedkat@gmail.com</a>></span><br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div class="gmail_quote">2010/4/20 Jay Hannah <span dir="ltr"><<a href="mailto:jhannah@omnihotels.com" target="_blank">jhannah@omnihotels.com</a>></span><div>
<div></div><div class="h5"><br><blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;">
<div link="blue" vlink="purple" lang="EN-US">
<div>
<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: "Courier New";">laugh... caught myself changing code to this</span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: "Courier New";"> </span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: "Courier New";"> my $response;</span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: "Courier New";"> unless ( $response = $self->send() ) {</span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: "Courier New";"> return 0;</span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: "Courier New";"> }</span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: "Courier New";"> return $response;</span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: "Courier New";"> </span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: "Courier New";">this is much better:</span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: "Courier New";"> </span></font></p>
<p class="MsoNormal"><font face="Courier New" size="2"><span style="font-size: 10pt; font-family: "Courier New";"> return $self->send();</span></font></p></div></div></blockquote></div></div><div><br>For some extra GOLF points you could <br>
<br>
{<br>
...<br>
$self->send();<br>
}<br> </div></div>-- <br>Ted Katseres<br> ||=O=||<br>
<br>_______________________________________________<br>
Omaha-pm mailing list<br>
<a href="mailto:Omaha-pm@pm.org">Omaha-pm@pm.org</a><br>
<a href="http://mail.pm.org/mailman/listinfo/omaha-pm" target="_blank">http://mail.pm.org/mailman/listinfo/omaha-pm</a><br></blockquote></div><br><br clear="all"><br>-- <br>***************** ************* *********** ******* ***** *** **<br>
"Quis custodiet ipsos custodes?"<br> (Who can watch the watchmen?)<br> -- from the Satires of Juvenal<br>"I do not fear computers, I fear the lack of them."<br> -- Isaac Asimov (Author)<br>** *** ***** ******* *********** ************* *****************<br>