No such thing as a small change | |
PerlMonks |
Re: RFC: Net::SNTP::Client v1by Monk::Thomas (Friar) |
on Jul 01, 2015 at 15:26 UTC ( [id://1132846]=note: print w/replies, xml ) | Need Help?? |
I am pretty sure the return is totally useless because die will terminate your program and that's it. Apart from that due to your indentation style it's pretty hard to determine whether you're actually in a returnable function or not. Additionally:
a) Decide to use a specific indentation style and then stick to it. The outer if-conditional has its codeblock indented, the inner one does not. That's very confusing. b) Using a 'true' value to indicate an error and a 'false' value to indicate success is counter-intuitive. Using '0' or 'undef' as the error-returns opens up the possibility to use the return value to provide more detail. (e.g. number of returned matches, length of read data, in your case it could be used to indicate the actual port used in case the default applies.) or maybe
In Section
Meditations
|
|