I have so far only read most of the code, not the documentation. Here are a couple of issues I noticed with the code. (Code snippets are untested.)

  1. BEGIN { die 'Perl version 5.6.0 or greater is required' if ($] < 5.006); } can be replaced by use 5.006;. Also, unless perlver is mistaken, the minimum required version for your code is v5.8.0.
  2. use base qw( Exporter ); our @ISA = qw ( Exporter );: You don't need to use base and modify @ISA. Also, that code can be replaced by simply use Exporter "import";; or, if you really want to inherit from Exporter, use parent instead of base.
  3. $dot is used only once, and is so simple that it should be inlined.
  4. Code like local *checkHashKeys = sub {: Don't do that without a good reason (and I don't see one). Use a "private" sub instead (a regular sub whose name begins with an underscore and that isn't exported). Several of your subs of this form are used only once and can and probably should be inlined.
  5. Your dec_2_hex can be replaced by sprintf('%02X%02X%02X%02X',$a,$b,$c,$d) or maybe join('',map {sprintf '%02X', $_} $a,$b,$c,$d) (note the uppercase X).
  6. Code like return ($error = "Not defined IP", \%moduleInput): $error will go out of scope immediately after the return, so assigning to it is not useful and confusing to readers, since it's not immediately apparent whether $error might be a package variable or not (which would actually make more sense than it being a lexical, as it currently is).
  7. Error handling in general: While the return values of your sub are certainly your choice, what you've chosen is uncommon. Perhaps you should be throwing errors with croak (Carp; that's how I'd likely do it), or, if you don't want to throw errors, return nothing (return;) and set a special error variable.
  8. Lots of unused variables, and several variables used only once like @arraySendSntpPacket that can be inlined.
  9. The body of your main while loop is not indented properly and you have several very long lines that should probably be wrapped.

Will you be releasing tests with this module?


In reply to Re: RFC: Net::SNTP::Server v1 by Anonymous Monk
in thread RFC: Net::SNTP::Server v1 by thanos1983

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.