Name : perl-Acme-CPANModules-Assert
| |
Version : 0.002
| Vendor : obs://build_opensuse_org/devel:languages:perl
|
Release : lp154.1.1
| Date : 2023-01-27 16:21:00
|
Group : Unspecified
| Source RPM : perl-Acme-CPANModules-Assert-0.002-lp154.1.1.src.rpm
|
Size : 0.03 MB
| |
Packager : https://www_suse_com/
| |
Summary : List of modules to do assertion
|
Description :
Assertion is a check statement that must evaluate to true or it will abort program\'s execution. It is useful during development/debugging:
assert(\"there must be >3 arguments\", sub { AATTargs > 3 });
In production code, compilers ideally do not generate code for assertion statements so they do not have any impact on runtime performance.
In the old days, you only have this alternative to do it in Perl:
assert(...) if DEBUG;
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).
|
RPM found in directory: /packages/linux-pbone/ftp5.gwdg.de/pub/opensuse/repositories/devel:/languages:/perl:/CPAN-A/15.4/noarch |