Subject: | Assertion code in non-strict mode causes warning. |
Fedora 27 Linux, perl 5.26.1, PerlX::Assert 0.905.
Consider a small test program:
$ cat test.pl
#!/usr/bin/perl
use strict;
use warnings;
use PerlX::Assert;
my $a = 0;
assert { $a > 0 };
# end of file #
$ PERL_STRICT=1 ./test.pl
Assertion failed at ./test.pl line 6.
Good, everything works as expected. Now let's try to disable assertions:
$ PERL_STRICT=0 ./test.pl
Useless use of numeric gt (>) in void context at ./test.pl line 6.
Oops. This warning is not a desired effect. I expect assertion code in non-strict mode is ignored or at least does not cause warnings.