Acme-CPANModules-Assert
view release on metacpan or search on metacpan
where "DEBUG" is a constant subroutine, declared using:
use constant DEBUG => 0;
or:
sub DEBUG() { 0 }
The perl compiler will optimize away and remove the code entirely when
"DEBUG" is false. But having to add "if DEBUG" to each assertion is
annoying and error-prone.
Nowadays, you have several alternatives to have a true, C-like
assertions. One technique is using Devel::Declare (e.g. PerlX::Assert).
Another technique is using B::CallChecker (e.g. Assert::Conditional).
ACME::CPANMODULES ENTRIES
* Assert::Conditional - conditionally-compiled code assertions
Author: TOMC <https://metacpan.org/author/TOMC>
lib/Acme/CPANModules/Assert.pm view on Meta::CPAN
where `DEBUG` is a constant subroutine, declared using:
use constant DEBUG => 0;
or:
sub DEBUG() { 0 }
The perl compiler will optimize away and remove the code entirely when `DEBUG`
is false. But having to add `if DEBUG` to each assertion is annoying and
error-prone.
Nowadays, you have several alternatives to have a true, C-like assertions. One
technique is using <pm:Devel::Declare> (e.g. <pm:PerlX::Assert>). Another technique is
using <pm:B::CallChecker> (e.g. <pm:Assert::Conditional>).
_
entries => [
{module=>'Assert::Conditional'},
{module=>'PerlX::Assert'},
lib/Acme/CPANModules/Assert.pm view on Meta::CPAN
where C<DEBUG> is a constant subroutine, declared using:
use constant DEBUG => 0;
or:
sub DEBUG() { 0 }
The perl compiler will optimize away and remove the code entirely when C<DEBUG>
is false. But having to add C<if DEBUG> to each assertion is annoying and
error-prone.
Nowadays, you have several alternatives to have a true, C-like assertions. One
technique is using L<Devel::Declare> (e.g. L<PerlX::Assert>). Another technique is
using L<B::CallChecker> (e.g. L<Assert::Conditional>).
=head1 ACME::CPANMODULES ENTRIES
=over
=item * L<Assert::Conditional> - conditionally-compiled code assertions
( run in 0.520 second using v1.01-cache-2.11-cpan-3cd7ad12f66 )