Acme-CPANLists-PERLANCAR
view release on metacpan or search on metacpan
lib/Acme/CPANLists/PERLANCAR/Assert.pm view on Meta::CPAN
In the old days, you only have this alternative to do it in Perl:
assert(...) if DEBUG;
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>).
=over
=item * L<Assert::Conditional>
=item * L<PerlX::Assert>
=item * L<Devel::Assert>
=back
=head1 HOMEPAGE
Please visit the project's homepage at L<https://metacpan.org/release/Acme-CPANLists-PERLANCAR>.
=head1 SOURCE
Source repository is at L<https://github.com/perlancar/perl-Acme-CPANLists-PERLANCAR>.
=head1 BUGS
Please report any bugs or feature requests on the bugtracker website L<https://rt.cpan.org/Public/Dist/Display.html?Name=Acme-CPANLists-PERLANCAR>
When submitting a bug or request, please include a test-file or a
patch to an existing test-file that illustrates the bug or desired
feature.
=head1 SEE ALSO
L<Acme::CPANLists> - about the Acme::CPANLists namespace
L<acme-cpanlists> - CLI tool to let you browse/view the lists
=head1 AUTHOR
perlancar <perlancar@cpan.org>
=head1 COPYRIGHT AND LICENSE
This software is copyright (c) 2017, 2016, 2015 by perlancar@cpan.org.
This is free software; you can redistribute it and/or modify it under
the same terms as the Perl 5 programming language system itself.
=cut
( run in 1.654 second using v1.01-cache-2.11-cpan-364913b4093 )