in reply to Re: RFC: Net::SNTP::Client v1
in thread RFC: Net::SNTP::Client v1

Hello toolic,

Thank you for your time and effort reading and reviewing my proposed module. I will read as you suggest the Pod and I will update accordingly. The reason That I am having two use inside the sub is that I am trying to utilize minimum possible RAM memory, since the moment that you call a module it is loaded in the memory (correct?).

Hmmm I did not even thought about it:

You should consider adding some checks on the inputs to your getSNTPTime sub.

Good idea.

Seeking for Perl wisdom...on the process of learning...not there...yet!

Replies are listed 'Best First'.
Re^3: RFC: Net::SNTP::Client v1
by toolic (Bishop) on Jun 30, 2015 at 17:24 UTC
    The reason That I am having two use inside the sub is that I am trying to utilize minimum possible RAN memory, since the moment that you call a module it is loaded in the memory (correct?).
    I don't think that is correct. From use:
    Because use takes effect at compile time, it doesn't respect the ordinary flow control of the code being compiled. In particular, putting a use inside the false branch of a conditional doesn't prevent it from being processed.

      Note for future: use applies only to the current scope in Perl 6.

      Done ;)

      Seeking for Perl wisdom...on the process of learning...not there...yet!
Re^3: RFC: Net::SNTP::Client v1
by RonW (Parson) on Jun 30, 2015 at 19:37 UTC
    The reason That I am having two use inside the sub is that I am trying to utilize minimum possible RAM memory, since the moment that you call a module it is loaded in the memory (correct?).

    If you require them instead of use them, then the module will only be loaded when you need them.

    For example, a number of CPAN module use the following as "front ends" to Carp so Carp is only loaded is needed.

    sub _carp { require Carp; Carp::carp(@_); } sub _croak { require Carp; Carp::croak(@_); }

      Hello RonW,

      Thank you for your time and effort reading/reviewing my code.

      Nice tip, I was not aware of it. :D

      Seeking for Perl wisdom...on the process of learning...not there...yet!