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 write
read $fh, 5, 10
or die;
Or if you want to make sure you read exactly x bytes, then you can write
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>';
}
(The // operator requires at least Perl 5.10.) |