in reply to Re^2: RFC: Net::SNTP::Client v1
in thread RFC: Net::SNTP::Client v1
The reason that I am using TRUE and FALSE is for simplicity and readability reasons in future. I think it makes it easier to understand in case of TRUE do that or in case of FALSE do that.
You can keep on doing that. Just switch the meaning of true and false. Have a look at read() http://perldoc.perl.org/functions/read.html
If you're not interested in the actual return code you can simply writeOr if you want to make sure you read exactly x bytes, then you can writeread $fh, 5, 10 or die;
(The // operator requires at least Perl 5.10.)my $bytes = 5; my $count = read $fh, $bytes, 10; if ($count == $bytes) { (do stuff) } else { die sprintf "Want %i bytes, got %s!", $bytes, $count // '<undef>'; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: RFC: Net::SNTP::Client v1
by thanos1983 (Parson) on Jul 02, 2015 at 13:14 UTC | |
by Monk::Thomas (Friar) on Jul 02, 2015 at 14:36 UTC | |
by thanos1983 (Parson) on Jul 02, 2015 at 22:29 UTC | |
by Monk::Thomas (Friar) on Jul 03, 2015 at 08:09 UTC |