I was writing a module as part of my application when I noticed syntax check results in warning about useless use of a constant (1). Why is that?
The constant is the obligatory 1
at the end of the module which is normally ignored by warnings as perldoc perldiag
says:
This warning will not be issued for numerical constants equal to 0 or 1 since they are often used in statements like
1 while sub_with_side_effects();
(There's probably an even better source for that. After all 1
at the end of files is totally desired and not to be warned about.)
But the warning is generated even for nearly empty modules if they use bigint
.
package Foo;
use bigint;
1;
For this simple file syntax check produces the following warning:
$> perl -Wc Foo.pm
Useless use of a constant (1) in void context at Foo.pm line 5.
Foo.pm syntax OK
I could not find any reference to bigint
and the warning message except Put long hex numbers in sqlite but this doesn't really address my issue, I think.
My Perl is v5.14.4 on Cygwin with bigint 0.36.